date ranges

how do  I write a date range from April 1, 2017 thru 11/30/2017
Tracey BradyAsked:
Who is Participating?
 
Dale FyeConnect With a Mentor Commented:
is this in a query?

WHERE [DateField] >= #04/01/2017# and [DateField] < #12/1/17#

I prefer to use < with 1 Dec than <= 30 Nov because if the [DateField] value contains a time component, then those records would not be included in the results.  Another way to do that is:

WHERE [DateField] >= #04/01/17# and DateValue([DateField]) <= #11/30/17#

In this case, the DateValue( ) function strips the time portion from the [DateField], similar to how cint( ) strips decimal places from real number.
0
 
Gustav BrockCIOCommented:
Or do you wish to generate a series of dates between those two dates?

/gustav
0
 
hnasrCommented:
What about:
 Between date1 And date2
0
 
Tracey BradyAuthor Commented:
Thanks
0
 
Dale FyeCommented:
you're welcome
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.