Sort date formatted as year and week

snowsride

Registered User.
Local time
Today, 21:19
Joined
Nov 29, 2001
Messages
33
I have a table with sales by day. I want to display the data in a graph summarised by week but the period spans several years. If I format the date thus Format(MyField,"yyyy ww") then Access sorts the results thus 2003 1, 2003 10, 2003 11 but it should be 2003 1, 2003 2, 2003 4 etc.

How can I get Access to sort in ascending order correctly on the formatted date?

Thanks
 
Keep the YYYY WW fld for display puposes but add a YYYY fld and a WW fld to do the sorts on. You may even have to val(WW) or something like that to make it work...

Make sense?
kh
 
sort date by week

Ken

Thanks - yes I've used that technique before it just doesn't seem a very elegant solution!

Regards
 

Users who are viewing this thread

Back
Top Bottom