Date Criteria Question

M

Myra

I have a set of data which shows the answers to questions asked for a
particular month and year. I have a query which will pull results for a
chosen month and year, which is entered through a form. The fields that I
have in the query are "Question", "Month", "Year", "Date Entered", "Answer".
I want the query to automatically filter out all records for that month that
occured before the 25th based off the "Date Entered" field, however I don't
want to have to input a timerange.
 
J

Jeff Boyce

Myra

Are you saying that you want the query to use the indicated Month and Year,
and want it to limit the rows return to those where the Day([Date Entered])
< 25?

(use the "< 25" as a criterion, and the Day([Date Entered]) as the "field")

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
N

Nick 'The database Guy'

Hi Myra,

You need to use the DateSerial function.

It has the follownig syntax DateSerial(year, month, day).

So it will look something like DateSerial(txtYear, txtMonth, 25)

Good luck

Nick McMillen
 
Top