date query

  • Thread starter Thread starter 111
  • Start date Start date
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
 
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
 
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)
 
Back
Top