PDA

View Full Version : date sorting in access



rev2000
24-02-2004, 05:35 PM
I have a database that has among other things birthdates sorted as dd,mm,yyyy
I want to be able to create a report that lists these birthdays in calendar order.

I have created a query to pull out the birtdates but I am not able to figure out how to sort the dates into order in this query or in the subsquent report.

Can someone help me please.

I am using access 2002

Thankyou

parry
24-02-2004, 08:25 PM
In the query there is a sort option. Simply click in that row and select Ascending or Descending. What data type is the date field - as a date or text?

Merlin
25-02-2004, 12:44 AM
Based on the presumption the date field is in dd/mm/yyyy format (ie you used date/time as the data type in the table)



Create a new report.

Base a query on the table

Use the day, month, year functions on the date field
In this example insert three fields containing the date field.
Use the above functions as:
day: Day([date]) where day is the field name to be used in the report and date is the field name used in the table,
month: Month([date]) where month is the field name to be used in the report and date is the field name used in the table,
year: Year([date]) where year is the field name to be used in the report and date is the field name used in the table


In the report use the sorting and grouping
Group by field, sort ascending/descending, use headers and footers as required.




Ask not what you can do for your country, ask what's for lunch
- Orson Welles on reaching 300 pounds