Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting a date field in a query 1

Status
Not open for further replies.

misha8765

Instructor
May 8, 2006
9
US
Thank you in advance for your help.

I have a date field 99/99/00

When I sort ascending in a query, it sorts the year first.

I want it to sort by month then day. Any idea?

Thank you
 
Is the data type of the field a datetime field?

If it is then the order you are seeing is the order that you get when you sort by the whole field.

Try something like
Code:
Order By Month(DateField), Day(DateField)

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
Thank you,

Where exactly would I put this code. The format is datetime
 
Switch to SQL view in your query and paste it in as the "ORDER BY" clause. Be sure to change the field name to the correct one for your query.

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top