I have a database written in access 97.
One of the field stored in the database is the date
I would like to report the entries for the last 24 hours.
What I did is I created a query and I sorted by decending date. This works because I see the new entries on top. However, the report shows all the rest of the entries.
How can I customize the report to automatically (without typing date range) to show the data for the last 24 hours.
You don't need to sort your records at all. you should add a calculated field to your query something like this:
Difference: Datediff("h", yourdatefield, now())
then enter this line as criteria for the calculated field: <24
what you do here is creating a calculated field which calculates the time difference between your datefield and current time in hourly interval then checks if it is less than 24.