Criteria and sorting

B

Bill Antolec

I have a very simple report based on a query shown below:

SELECT Updates.Department, Updates.Top_PAE, Updates.Resources,
Updates.To_Thank, Updates.Comments, Updates.Date
FROM Updates
WHERE (((Updates.Date)>(Date()-7) And (Updates.Date)<=Date()))
ORDER BY Updates.Department;

Here is the situation. People are entering information into a form. Two
important pieces of information entered are the date and department. They
will do this once each week.

After all the departments have entered their information a report is run
selecting only the entries for this week - thus the where criteria of
anything entered the last 7 days including today. The report is to be
sorted by the department field.

All of the data is being selected correctly, however, Access seems to insist
on including the date in the sort. That means the actual sort order
appearing on the report is date and then department. If I remove the date
from the query, I get all records in the database, not just the last weeks
set of records. Any ideas out there?

Thanks in advance for your assistance with this.

Bill Antolec
(e-mail address removed)
 
A

Allen Browne

Open the report in design view.
Open the Sorting And Grouping dialog (View menu.)
Specify the sorting there.

The sorting in the query is irrelevant, i.e. you can drop the ORDER BY
clause from the query.
 
B

Bill Antolec

Thanks Allen!

That sure took care of the problem. It's easy when you know where to look!
:)

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top