Results 1 to 5 of 5
  1. #1
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117

    Question First Date & Last Date

    hi all,



    i used DatePart("ww", Date, vbSaturday) to get week number.

    now i want to get week first date and last date.

    can any one tell me how can i get?

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Please advise where you are trying to do this. What are you trying to accomplish. Not enough details here.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You want first and last dates of the week - Sunday and Saturday? Week number won't help. Need the day of week then calculate. This will return the first day (Sunday):
    x = [datefield] + (Weekday([datefield]) * (-1) + 1)

    If you want Saturday as first day of week then remove the +1.

    Last day then: x + 6
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117
    thanks all,

    actually i want to get dates from given week number.

    let say week = 38 is week number now i want to get week 38 first date and last date week should start from saturday not from sunday

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You start with a Date value, the week number is irrelevant. Reread and try my suggestion.

    If you are given a week number and year, try
    http://forums.aspfree.com/visual-bas...ear-19439.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Parameter Date - Force a Monday Date
    By ker9 in forum Queries
    Replies: 3
    Last Post: 07-26-2011, 01:06 PM
  2. query to update a date based on another date
    By tkendell in forum Access
    Replies: 3
    Last Post: 06-29-2011, 09:32 PM
  3. Replies: 1
    Last Post: 02-06-2011, 06:36 PM
  4. Replies: 1
    Last Post: 07-07-2010, 04:22 PM
  5. Replies: 1
    Last Post: 12-09-2005, 10:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums