Add More parameters to get the year. But that is going to make this more
complex and tedious for the person using it.
You could ask them for the Start Date and End Date. If you need the entire
month then you can adjust it.
Between DateSerial( Year([Enter Start Date]),Month([Enter Start Date]),1)
And
DateSerial( Year([Enter EndDate]),Month([Enter EndDate])+1,0)
You could change the message a bit to [Enter date in start month]
Check out this article for a detailed discussion on using a form to get the
input.
http://www.fontstuff.com/access/acctut08.htm
A brief quote from an John Vinson (Access MVP) posting on using a form
You'll need to create a small unbound Form (let's call it frmCriteria) with
a Combo Box control (cboCrit) on it. Use the combo box wizard to select the
table for the selections, and be sure that the bound field of the combo is
the value you want to use as a criterion. Save this form.
Now use
=[Forms]![frmCriteria]![cboCrit]
as the criterion in your Query.
It's convenient to base a second Form or Report on the resulting query to
display the results; if you put a button on frmCriteria to launch that form
or report, the user can enter the criterion and view the results in one
simple operation!
Quoting John Vinson
Secret Squirrel said:
I currently have the following in my select query but I want to be able to
select a year as well. How would I incorporate that into my query? This is
what I have in there so far:
Between DateSerial(Year(Date()),[Enter Starting Month],1) And
DateSerial(Year(Date()),[Enter Ending Month]+1,0)