Parameter Query for Year

BruceFrey

Registered User.
Local time
Today, 08:03
Joined
Dec 12, 2002
Messages
20
Hello Everyone

Instead of having a parameter query ask beginning date and ending date I'd like it to just ask for the year and then have my query display records for that year.

Is there a simple way to do this?
 
SELECT .............
FROM [TableName]
WHERE Year([DateFieldName]) = [Enter a year]

^
 
reply to parameter query for year

Hello

Thank you for the response. I'm in my parameter query now and can't get it to work. I'm trying to type the following into the criteria part of the query =WHERE Year([Date]) = [Enter a year]

Did you want me to type this somewhere else?
 
You can switch the query to SQL View and type the Where Clause as shown by EMP.

Then you can switch back to query Design View to see how Access has put the criteria in the query grid for you.

Note: Date is a built-in function. Better avoid using it as a field name.
.
 
Thank You

Thank you for the heads up on the SQL view. I went in and changed the view and was successful in changing the parameter query to asking for the year.

Thanks again for responding.
 

Users who are viewing this thread

Back
Top Bottom