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

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
 
J

Jeff Boyce

Simon

Couldn't you just sort by [OrderDate]?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
C

Clifford Bass

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top