Question Locked

Access 2003 Sorting and Grouping ?

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am sorting by "week" in a report on the creation date field that renders all records when I run the report(even records over a week old). I have double checked all aspects of this database. It is a very simple database with NO PROGRAMMING or Macros.

If I need to resort to VBA or Macros so beit.

7 replies

by georgeou

You can easily sort things out using Access 2003 built-in query capability. You can literally drag and drop the fields in to the editor and select how you want to filter or sort the data.

by michael.erskine.ctr

I am trying to retrieve the last seven days of records and only the last seven. When I tried to use the query only I couldnot getit to work however, when I used the Sorting and Grouping in the report itself it seemed to work until the records older than seven days started to pop up.

by georgeou

Try this for "criteria" for the "Date" column in the Query editor.
>(Date()-7)

This gives you the last 7 days. If you want before the last 7 days, use a < instead of the >. You can obviously adjust the 7 day value as well.

by michael.erskine.ctr

that worked for the 7 days and the acid test for 30 days is coming up...thank you very much for your help on this issue.

Another question...where is the syntax for the formatting of criteria like this?

I tried date()-7 without the >() around the statement and of course it did not work.

by georgeou

If you dind't use the outer (), then you're doing > the current date operation first and then subtracting that by 7. If in doubt, use the () to enclose your arguments to force the proper order execution.

This discussion is closed to new replies.