date range question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a database in which the date format is dd-mmm-yy. How do I
make a query to just get information by month and not specific date?
 
Assuming you are using a DateTime field rather than a text field put this in
the design view of your query grid --
Format([YourDateField],"yyyymm")

In the criteria row under the above field --
[Enter year & month -- 200604 for April 2006]
 
Hi,




.... WHERE DatePart("m", DateTimeValue) = 2


for February. The date time value can be a constant, or a field.


You can also use


.... WHERE MONTH( dateTimeValue) = 2


as example



Hoping it may help,
Vanderghast, Access MVP
 
ckehrer said:
I have created a database in which the date format is dd-mmm-yy. How do I
make a query to just get information by month and not specific date?

Another suggestion:

WHERE MyDateValue BETWEEN
#2006-07-01 00:00:00# AND #2006-07-31 23:59:59#

Jamie.

--
 
I'm confused!! Where do I put the format statement at?

KARL DEWEY said:
Assuming you are using a DateTime field rather than a text field put this in
the design view of your query grid --
Format([YourDateField],"yyyymm")

In the criteria row under the above field --
[Enter year & month -- 200604 for April 2006]


ckehrer said:
I have created a database in which the date format is dd-mmm-yy. How do I
make a query to just get information by month and not specific date?
 
Open/create your query in design view. Select the fields you want to display.
In a blank column of the grid in Field row enter this --
DateSelect: Format([YourDateField],"yyyymm")

In the Criteria row below the above enter this --
[Enter year & month -- 200604 for April 2006]


ckehrer said:
I'm confused!! Where do I put the format statement at?

KARL DEWEY said:
Assuming you are using a DateTime field rather than a text field put this in
the design view of your query grid --
Format([YourDateField],"yyyymm")

In the criteria row under the above field --
[Enter year & month -- 200604 for April 2006]


ckehrer said:
I have created a database in which the date format is dd-mmm-yy. How do I
make a query to just get information by month and not specific date?
 
Back
Top