simple code required

superhorse

Registered User.
Local time
Today, 14:15
Joined
Apr 14, 2008
Messages
13
Just a quick one to ask is there some simple code for the following problem.

In a query I want the criteria for a date field to display all the dates when the month in a text box on a form matches the month for the field the criteria is being entered into. All dates are in the format dd/mm/yyyy and I'm not sure how to search just the month.

Any help would be appreciated, cheers.
 
Look up DatePart() in Access help. You can isolate the month by using the option "m". But be certain that your regional settings are right, first.
 
In SQL view, try

WHERE Month(DateField) = Month(Forms!FormName.TextBoxName)

or just the form reference if all that's in the textbox is a number 1-12.
 

Users who are viewing this thread

Back
Top Bottom