Qry Dates in a table

G

Guest

Hello Group,
I need to build a form with 3 drop down fields on it. Month, Day, and Year.
I need to qry my table and look for a month or day or year. An example,
I want to pull up records for 01/15/*, or 01/*/*. How would I do that?

Forms!MyForm!cboMonth & forms!MyForm!cboDay & Forms!MyForm!cboYear

Something on that Idea.
Thanks for your help in advance.
Grant
 
D

Douglas J. Steele

Dates in Access are numbers, so you can't use wildcards with them.

What you could do is add three computed fields to your query: one that uses
the Year function to return the year from the date, one that uses the Month
function and one that uses the Day function. Then, you could put the
following criteria under the Year field:

Forms!MyForm!cboYear Or (Forms!MyForm!cboYear IS NULL)

Put the appropriate criteria under the other two fields.
 
G

Guest

Thanks Douglas.. Worked great..
Grant

Douglas J. Steele said:
Dates in Access are numbers, so you can't use wildcards with them.

What you could do is add three computed fields to your query: one that uses
the Year function to return the year from the date, one that uses the Month
function and one that uses the Day function. Then, you could put the
following criteria under the Year field:

Forms!MyForm!cboYear Or (Forms!MyForm!cboYear IS NULL)

Put the appropriate criteria under the other two fields.
 

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