One report based on different queries

W

Wendy

Hi

I have a report which works fine and extracts data based on yesterday's
date. Now I need to be able to run the same report for a specific date the
user enters, but I also need to keep the 'yesterday' option..

The date field is used as an 'or' on 5 different fields in the query.

Can I change the reports source to run on whichever query determined by
whether the user enters a date or selects the yesterday option from a form?

I'm thinking possibly sql but my knowledge of writing sql is nil!

Can you point in me in the right direction please?

Thanks

Wendy
 
D

Duane Hookom

You should create a form with controls to enter dates. Then use references
to the controls in your one query that is used as the record source for the
report. Your criteria might have something like:

=Forms!frmDates!txtStartDate

Testing the same date against 5 different fields suggests your table(s)
might be un-normalized.
 
K

Klatuu

And to use Yesterday's date as the default, Make the Default Value of
txtStartDate, put this in the Default Value property"
=DateAdd("d", -1, Date())
 

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