Find a given month (12-Oct-05)

G

Guest

I have an orders database and want to search for all orders in a given month.
I would like to be able to enter (ie in a paramter query) and then filter
all orders by that month. Could also be applied to a given year. The Date
field is in Medium Date format.
 
J

Jeff Boyce

Ricardo

The format of a field only controls how it appears, not how it is stored.

If you wished to find all rows with an [OrderDate] of, say, April (month =
4), you could add a selection criterion under a new field:

NewField: Month([OrderDate])

like:

[Enter Month Number]

in a query design view grid.

This tells Access to prompt the user for a value, then uses that value as a
criterion for the field it is under (i.e., the "month" of the order date).

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
G

Guest

This will give you data from April 2007, April 2006, April 2005, etc.
I recommend the following --
NewField: Format([OrderDate],"yyyymm")

and

Format([Enter month (Like 1/4/2007)], "yyyymm")

in a query design view grid criteria.


--
KARL DEWEY
Build a little - Test a little


Jeff Boyce said:
Ricardo

The format of a field only controls how it appears, not how it is stored.

If you wished to find all rows with an [OrderDate] of, say, April (month =
4), you could add a selection criterion under a new field:

NewField: Month([OrderDate])

like:

[Enter Month Number]

in a query design view grid.

This tells Access to prompt the user for a value, then uses that value as a
criterion for the field it is under (i.e., the "month" of the order date).

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Ricardo said:
I have an orders database and want to search for all orders in a given month.
I would like to be able to enter (ie in a paramter query) and then filter
all orders by that month. Could also be applied to a given year. The Date
field is in Medium Date format.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top