Easy date query

Portista

New member
Local time
, 19:30
Joined
Aug 2, 2006
Messages
6
G'day all,
I'm a novice to Access. I'm trying to setup an adhoc query, whereby a user can select all the records for a particular month.
I've tried using ([month]) in the criteria row but I get an error message??? :confused: :confused:
 
re:

Hi,
create a new expression in your query which pulls out the month value of the date/time field e.g.:

JustMonth: Month([YourDateTimeField])
Then use criteria on that expression e.g.:
[Enter Month Number:]

HTH
Good luck
 
Something to be aware of here, if you have more than 1 years worth of data the above method will return all values for the selected month for both years. i.e. 01/01/2005 and 01/01/2006 will both be selected.
 
:confused:

I did as you said however I get an error message stating that: "You tried to execute a query that does not include a specifed expression 'Month([Startdate])=[Month]' as part of an aggregate function.

If I remove the criteria the query result shows the number for each month, but if I add the criteria that error message pops up.
 
re:

Hi,
you need to create a new expression in the query e.g.:

JustMonth: Month([YourDateField])

Then you can use criteria on that field expression to ask for the month number e.g.:

Criteria: [Month Number:]

Now if you run the query it should pop up the input parameter box...when a correct number is provided it should return the expected results.
HTH
Good luck
 

Users who are viewing this thread

Back
Top Bottom