Date check on query

J

Jeff

I'm trying to write a query that looks at a particular date field to
see if the record should be included in my counts. In most cases, this
field is blank, and is only filled in on certain cases.

I want my query to look at records where the value is not null and
between the start and stop date for the report.

I tried
Is not null and > start date and < stop date

But it gives me a data mismatch error.

Suggestions?

Thanks

Jeff
 
M

Marshall Barton

Jeff said:
I'm trying to write a query that looks at a particular date field to
see if the record should be included in my counts. In most cases, this
field is blank, and is only filled in on certain cases.

I want my query to look at records where the value is not null and
between the start and stop date for the report.

I tried
Is not null and > start date and < stop date

But it gives me a data mismatch error.

The records with Null in the date field will not match
anything so you can ignote them in this case. Try setting
the criteria to:

Between [Start Date] And [End Date]

Note that that the [ ] are required.
 
L

louisjohnphillips

I'm trying to write a query that looks at a particular date field to
see if the record should be included in my counts. In most cases, this
field is blank, and is only filled in on certain cases.

I want my query to look at records where the value is not null and
between the start and stop date for the report.

I tried
Is not null and > start date and < stop date

But it gives me a data mismatch error.

Suggestions?

Thanks

Jeff

Is this -- "Is not null and > start date and < stop date" your exact
query? Have you tried

"where [particular date] > [start date] and [particular date] < [stop
date]"?

Have you tested all non-null values of [start date] and [stop date] to
insure that they will pass the IsDate() test?
 

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