Easy date query (1 Viewer)

Portista

New member
Local time
Yesterday, 21:12
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:
 

freakazeud

AWF VIP
Local time
Yesterday, 23:12
Joined
Sep 10, 2005
Messages
221
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
 

Karma

Registered User.
Local time
Today, 03:12
Joined
Jun 9, 2006
Messages
105
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.
 

Portista

New member
Local time
Yesterday, 21:12
Joined
Aug 2, 2006
Messages
6
: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.
 

freakazeud

AWF VIP
Local time
Yesterday, 23:12
Joined
Sep 10, 2005
Messages
221
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

Top Bottom