Query Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to write a select query with a field called Run Date. The date
format is mm/dd/yyyy(10/10/2005). I want the user to enter a date parameter
and have them only enter the first 2 digits of the month. Something like 10*.
I have tried the Like operator with the * wildcard but can't quite get it to
work correctly with the date formats.

Any ideas on this approach?
Thanks to all to reply....
 
I am trying to write a select query with a field called Run Date. The date
format is mm/dd/yyyy(10/10/2005). I want the user to enter a date parameter
and have them only enter the first 2 digits of the month. Something like 10*.
I have tried the Like operator with the * wildcard but can't quite get it to
work correctly with the date formats.

Any ideas on this approach?
Thanks to all to reply....

Where Month([RunDate]) = [Enter the Month Number]

Entering 10 will return October records *for all the years in the
database*. Is that really what you want?

A better approach might be:
Where Format([RunDate],"mm/yyyy") = [Enter mm/yyyy]
Enter 02/2005 to get records of just Feb. 2005.
 

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