Sorting Records by date

J

Joy

I'm stuggling with creating a report that shows cases that
have been resolved in the past 30 days and all cases YTD
that are unresolved. My table has fields titled
DateReceived and DateResolved. If I place the criteria
for DateResolved as Null, I will get all the unresolved
cases YTD, but how do I get list the criteria for cases
received for the past 30 days. I've already used the
DateResolved criteria as Null? Any help is appriciated.
Thank you
 
J

Jeff Boyce

Joy

Base your report on a query.

Set the criterion of the [DateResolved] to Null.

Set the criterion of the [DateReceived] to something like
Date() - 30

Sort by this field as well.

Include any other fields in the query you'll need in your report.
 
J

Joy

Thanks for the help. I still have one problem, I need to
see all the cases that have been resolved in the past 30
days and also show all the unresolved cases. The [Date
Resolved] is null will get me all my unresolved records,
but I need to get my resolved records for the past 30 days
and I can't seem to accomplish this on one query. Any
more suggestions? Thank you in advance.
-----Original Message-----
Joy

Base your report on a query.

Set the criterion of the [DateResolved] to Null.

Set the criterion of the [DateReceived] to something like
Date() - 30

Sort by this field as well.

Include any other fields in the query you'll need in your report.

--
Good luck

Jeff Boyce
<Access MVP>
.
 
J

Jeff Boyce

Joy

That sounds like a UNION query.

Query 1 gets you the unresolved.

Build Query 2 to find the "last 30 days" resolved cases.

Build a 3rd Query. Open the SQL window. Paste in the SQL from Q1. Add the
UNION statement. Paste in the SQL from Q2.

UNION queries require that both "legs" have the same number of fields (and
to make much sense, need to have the same fields, in the same order).
Syntax counts, so take a look at the Access HELP on UNION queries for an
example.
 

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