Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jan 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Datepart (Access XP)

    I've created a datepart in a query that will allow me to extract the week number for example datepart("ww",[exdate]) , that allows me to group that information. I'm also trying to take that week number and get the actual date in which that week begins. Can anyone help me?

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Datepart (Access XP)

    The simplest way to do that is to determine the day of the week from [exdate] using the WeekDay() function - then subtract that value minus 1 from [exdate] to establish the first day of the week. (The function does have a parameter that you can specify the first day of the week with - it may be useful if your weeks don't start on Sunday.)
    Wendell

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Datepart (Access XP)

    <P ID="edit" class=small>(Edited by Francois on 04-Jan-05 20:18. edit to replace the semicolon by comma (european settings))</P>This should give you the first day of the week :
    Firstweekday: [exdate]-DatePart("w",[exdate])+1
    Francois

  4. #4
    New Lounger
    Join Date
    Jan 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Datepart (Access XP)

    It worked!! Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •