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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to sort a Date field

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi,

I have this Date field in the following format:
Expr1: Format([DateCreated],'mmmm", "yyyy')

When I try to sort it, say, descending, I get the following:

September, 2002
October, 2002

So, as I understand it sorts it as a string, rather then as a date

What should I do to get:

October, 2002
September, 2002
Etc.

Thanks.
 
Hi

A few possibilities here, but for one:

Make yourself another calculated field in your query so:

Expr2: Format(Year([DateCreated]),"0000") & Format(Month([DateCreated]),"00")

and sort on that

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
You should be able to add the DateCreated field to the query, sort on that, and don't show it. Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top