Date query

  • Thread starter Thread starter Tony Williams
  • Start date Start date
T

Tony Williams

I have a table that includes a date field txtexpirydate with dates in the
future. I want to set up a query that finds all records where the date field
is in the future ie after today. I've tried using > Date() but that doesn't
seem to work. How do I do this?
Thanks
Tony
 
What does "doesn't seem to work" mean? Are you getting any recordset back,
are you getting some records, but not all, or are you getting incorrect
records back?

Is txtexpirydate a Date/Time field, or a Text field?
 
If txtExpiryDate is a DateTime field, then what you have should work. The "txt"
prefix to the field name would indicate to me that the field is a text field and
not a datetime field.

As a test try using a calculated field in the query.

Field: RealDate: DateValue([txtExpiryDate])
Criteria: > Date()

If that still gives you problems. You can check other things - such as do you
have a field named "Date"
 
Thanks guys I found a field that had been created by someone called Date and
that was screwing the whole thing up.
Thanks again sorry to have wasted any time.
Tony
John Spencer said:
If txtExpiryDate is a DateTime field, then what you have should work. The
"txt"
prefix to the field name would indicate to me that the field is a text
field and
not a datetime field.

As a test try using a calculated field in the query.

Field: RealDate: DateValue([txtExpiryDate])
Criteria: > Date()

If that still gives you problems. You can check other things - such as do
you
have a field named "Date"

Tony said:
I have a table that includes a date field txtexpirydate with dates in the
future. I want to set up a query that finds all records where the date
field
is in the future ie after today. I've tried using > Date() but that
doesn't
seem to work. How do I do this?
Thanks
Tony
 

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

Back
Top