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?
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?
Please advise where you are trying to do this. What are you trying to accomplish. Not enough details here.
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.
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
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.