date query

1

111

I have a select query with the following field:

year: DatePart("m",[Date]) & ", " & DatePart("yyyy",[Date])

this returns dates such as 9,2003 & 11,2003 etc.
this is fine but i would like to have these dates now listed in decending
order.
When i set the query to sort decending i get:
9,2003
8,2003
11,2003
10,2003

This isn't the chronological order i was hoping for.

Can anyone tell me how to get these dates to list properly?
tks
Steve
 
T

tina

you could add the Date field to the QBE grid and set the
sort order to Descending, instead of sorting on the
calculated field. you can uncheck the box on the Show line
so that the Date field is not included in the query
results.

hth
 
V

Van T. Dinh

When you use cocatenation, the end resrult is a String and in comparing
String, "9..." is "higher" than "1..." regardless of the following
characters. Thus, "9,2003" is listed first in descending sort.

Retain the Column for display but sort by your original [Date] Field.

HTH
Van T. Dinh
MVP (Access)
 

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