Must reenter dates in table for parameter query to work

G

Guest

A table has several hundred records with populated date fields. However,
Parameter queries for records based on particular dates results in zero
records. But, if I reenter the dates, then the parameter query works fine
for the rentered dates (and for records with recently entered dates).

I don't want to have to reenter all of these dates to get the query to work.

Any ideas?
 
A

Allen Browne

How do the dates get into the table? Are they entered by default, where you
have set the Default Value to:
=Now()
If so, the fields contain a *time* component as well as a date, and that
would be why they do not match. Change the Default Value to:
=Date()
instead. The new values will now contain no time component.
You can strip the time from the existing records with an Update query
(Update in query design view), and use DateValue().

If that is not the issue, it may be that Access is misunderstanding the data
type of the parameter. Declare the parameter (Parameters on Query menu in
query design.) For an explanation, see:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
 

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