Display month as 01, 02 ect not 1, 2 , 3

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I havea query that shows sales taking by Week

Year: Format([OrderDate],"yyyy ww")

I then sort by hight to low but i comes up as

Year
2009 2
2009 19
2009 18
2009 17
2009 16
2009 15
2009 14
2009 13
2009 12
2009 11
2009 1

But this is not in order as the months need to be 01, 02, 03

How would i go about putting it as 01 02 03 instead of 1 2 3 ect

Thanks
 
Simon

Couldn't you just sort by [OrderDate]?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Hi Simon,

Instead of formatting it, split it up into two columns and sort on those:

SELECT Year([OrderDate]) AS Year_Sort, DatePart("ww",[OrderDate]) AS Week_Sort
FROM tblOrders
ORDER BY Year([OrderDate]), DatePart("ww",[OrderDate]);

Clifford Bass
 
Back
Top