Selecting Dates

A

Andrew Frazier

How do I create a query that will allow me to select all
records with the same date in different years - for
example all January 1 or all June 16?

TIA
 
D

Douglas J. Steele

One way is to create two computed fields in your query, one of them using
the Day function on your date field, and the other using the Month function.
You'd then supply the appropriate values as criteria for those computed
fields. Note that you'd need to supply 1 for January or 6 for June using
this approach.

Another approach would be to use Format([MyDate], "mmmm d") as a single
computed field. Now you can supply the string "January 1" or "June 16".
However, you then need to be sure that they don't misspell the month name,
and that they don't accidentally put 2 spaces (or, in this case, January 01)
 
A

Angel_G

I tried the following and it worked for me.
In the query criteria under the date field I put the following:
Like [Enter Date] & "/*"
all I had to type when prompted to enter the date was 6/1 and it gave me all
records for all years for 6/1
Hope this works for you as well!
 

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