sorting by day and month, not year

  • Thread starter Thread starter Josh
  • Start date Start date
J

Josh

i would like to sort dates (mm/dd/yyyy) in the order they
happen in the year---for example jan 1, 1981 should come
before aug 1, 1955---how do i sort by dates this way on
data that recorded dates by mm/dd/yyyy? thanks
 
Create 2 additional fields (calculated fields) in your query. Uncheck the
Show box if you like, this will only be use for sorting. Set the sort on
each to Ascending.

SortMonth:Month([TableName].[DateField])
and
SortDate:Day([TableName].[DateField])

Place the month field to the left of the date field to sort by month first,
then date.
 
Alternatively, you could create a single field SortField:
Format([TableName].[DateField], "mmdd") and sort on it.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Wayne Morgan said:
Create 2 additional fields (calculated fields) in your query. Uncheck the
Show box if you like, this will only be use for sorting. Set the sort on
each to Ascending.

SortMonth:Month([TableName].[DateField])
and
SortDate:Day([TableName].[DateField])

Place the month field to the left of the date field to sort by month first,
then date.

--
Wayne Morgan
MS Access MVP


Josh said:
i would like to sort dates (mm/dd/yyyy) in the order they
happen in the year---for example jan 1, 1981 should come
before aug 1, 1955---how do i sort by dates this way on
data that recorded dates by mm/dd/yyyy? thanks
 
Back
Top