selecing a month instead of start/end date

sloth

Registered User.
Local time
Today, 00:06
Joined
May 3, 2002
Messages
22
hi, i need to have a parameter that allows someone to type in a month, say 'April' and then to list all the records.
my question is can you do it this way? im trying to avoid using start date and end date, as they would have to type in twice.
im not sure how to set the criteria up for this one.. any ideas?
 
Use the format command in your query. Rather than allowing for typing errors, you may be better off using a combo or list box though.

In the query, for the date field that you want to limit records to Rather than the field, type SelectedMonth: Format([NameofDateField],"mmmm") This will change the date into a full month text ie April etc then it will match to the value you enter in the parameter, combo etc.

HTH
 
Make sure you account for Year as well if that's important to your results.
 
This example, using Orders1, a copy of Northwind's Orders table, prompts for a mm/yyyy (e.g., 04/1995) and returns all records with an Order date in that month.

SELECT Orders1.*
FROM Orders1
WHERE (((Orders1.OrderDate) Between DateValue([enter mm/yyyy]) And DateSerial(Year(DateValue([enter mm/yyyy])),Month(DateValue([enter mm/yyyy]))+1,0)));
 

Users who are viewing this thread

Back
Top Bottom