S
Sandy Eastman
Using Access 2000 on Win2000Pro
I have a date field in my data and I need to group and sort summarized data
by YearWeek but the format() function is not doing what I need it to do.
The format function defaults the first week of the year as the week
containing Jan 1 and weeks are not returned as 2 digits.
How can I get a YearWeek that is accurate and can be used to sort.
using Format([REQUIRED_BY_DATE],"yyyyww",1,2)
1st problem:
you dont get 2 digit week numbers
Jan 5, 2004 is returned as 20041
.... so you cant use this to accurately sort the data.
2nd Problem:
Jan 1, 2004 is returned as 200453 instead of 200353
.... so again you can't sort properly.
I can get around the 2 digit week problem with:
Format([REQUIRED_BY_DATE],"yyyy",1,2) &
Format(Format([REQUIRED_BY_DATE],"ww",1,2),"00")
....but the year is still wrong for Jan 1, 2004
I have a date field in my data and I need to group and sort summarized data
by YearWeek but the format() function is not doing what I need it to do.
The format function defaults the first week of the year as the week
containing Jan 1 and weeks are not returned as 2 digits.
How can I get a YearWeek that is accurate and can be used to sort.
using Format([REQUIRED_BY_DATE],"yyyyww",1,2)
1st problem:
you dont get 2 digit week numbers
Jan 5, 2004 is returned as 20041
.... so you cant use this to accurately sort the data.
2nd Problem:
Jan 1, 2004 is returned as 200453 instead of 200353
.... so again you can't sort properly.
I can get around the 2 digit week problem with:
Format([REQUIRED_BY_DATE],"yyyy",1,2) &
Format(Format([REQUIRED_BY_DATE],"ww",1,2),"00")
....but the year is still wrong for Jan 1, 2004