By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,508 Members | 2,949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,508 IT Pros & Developers. It's quick & easy.

How te return in a query all the dates between a date 1 and a date 2 ?

P: n/a
JD
Example

Give me all the dates between 02/02/07 and 05/02/07 ?
In Europe the answer must be 4 dates : 02/02/07 ; 03/02/07 ; 04/02/07 ;
05/02/07.

JD.

Feb 14 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
If you mean that you want to filter all records that contain a date value
between XX and YY in a certain field, then create a select query and set the
criteria in the date field to:
Between #02/02/07# and #05/02/07#

or better yet:

Between [Enter START Date (mm/dd/yy)] and [Enter END Date (mm/dd/yy)]

or even better, create a pop-up form with unbound controls to capture user
entered dates, then use those values in your query.

Between Forms!MyForm!StartDate and Forms!MyForm!EndDate

-Ed
"JD" <jd*******@hotmail.comwrote in message
news:45**********************@news.skynet.be...
Example

Give me all the dates between 02/02/07 and 05/02/07 ?
In Europe the answer must be 4 dates : 02/02/07 ; 03/02/07 ; 04/02/07 ;
05/02/07.

JD.

Feb 14 '07 #2

P: n/a
JD
No,
I mean an answer like in my example...
Thanks,

"Ed Robichaud" <ed*********@wdn.comschreef in bericht
news:45**********************@news.wdn.com...
If you mean that you want to filter all records that contain a date value
between XX and YY in a certain field, then create a select query and set
the criteria in the date field to:
Between #02/02/07# and #05/02/07#

or better yet:

Between [Enter START Date (mm/dd/yy)] and [Enter END Date (mm/dd/yy)]

or even better, create a pop-up form with unbound controls to capture user
entered dates, then use those values in your query.

Between Forms!MyForm!StartDate and Forms!MyForm!EndDate

-Ed
"JD" <jd*******@hotmail.comwrote in message
news:45**********************@news.skynet.be...
>Example

Give me all the dates between 02/02/07 and 05/02/07 ?
In Europe the answer must be 4 dates : 02/02/07 ; 03/02/07 ; 04/02/07 ;
05/02/07.

JD.


Feb 14 '07 #3

P: n/a
"JD" <jd*******@hotmail.comwrote in news:45d35383$0$3130
$b*******@news.skynet.be:
Example

Give me all the dates between 02/02/07 and 05/02/07 ?
In Europe the answer must be 4 dates : 02/02/07 ; 03/02/07 ; 04/02/07 ;
05/02/07.
What is it in Antarctica?
Feb 14 '07 #4

P: n/a
Look in Access Help for the DateDiff() function. It will return the number
of date units between 2 dates.
-Ed

"JD" <jd*******@hotmail.comwrote in message
news:45**********************@news.skynet.be...
No,
I mean an answer like in my example...
Thanks,

"Ed Robichaud" <ed*********@wdn.comschreef in bericht
news:45**********************@news.wdn.com...
>If you mean that you want to filter all records that contain a date value
between XX and YY in a certain field, then create a select query and set
the criteria in the date field to:
Between #02/02/07# and #05/02/07#

or better yet:

Between [Enter START Date (mm/dd/yy)] and [Enter END Date
(mm/dd/yy)]

or even better, create a pop-up form with unbound controls to capture
user entered dates, then use those values in your query.

Between Forms!MyForm!StartDate and Forms!MyForm!EndDate

-Ed
"JD" <jd*******@hotmail.comwrote in message
news:45**********************@news.skynet.be...
>>Example

Give me all the dates between 02/02/07 and 05/02/07 ?
In Europe the answer must be 4 dates : 02/02/07 ; 03/02/07 ; 04/02/07 ;
05/02/07.

JD.



Feb 14 '07 #5

P: n/a
On 14 Feb., 19:22, "JD" <jdwacc...@hotmail.comwrote:
Example

Give me all the dates between 02/02/07 and 05/02/07 ?
In Europe the answer must be 4 dates : 02/02/07 ; 03/02/07 ; 04/02/07 ;
05/02/07.
Hi,

in the one Europe I live, the dates between 02/02/07 and 05/02/07 are
two: 03/02/07 and 04/02/07

Anyway, you can try this

select somefield from sometable where somedate >= #02/02/07# and
somedate <= #05/02/07#

Greetings
Marco P

Feb 14 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.