473,473 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
5 2695
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
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
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jorey Bump | last post by:
I can retrieve today's date: mysql> SELECT CURDATE() AS begin; +------------+ | begin | +------------+ | 2005-06-01 | +------------+ 1 row in set (0.00 sec)
1
by: Ken | last post by:
I wrote a function to use in queries that takes a date and adds or subtracts a certain length time and then returns the new value. There are times when my function needs to return Null values. ...
13
by: Sara | last post by:
I have a query that pulls data for the month, using the Month End Date from a form (user enters) as criteria. It works. I want to use the same query to pull "month to date" data, on a weekly...
8
by: MLH | last post by:
Anybody's solution would be appreciated. Pls, do not pause to write anything for this. I'm not looking for that kind of a handout. I have an idea about how to do it, but I wanted to see if anyone...
6
by: Bill R via AccessMonster.com | last post by:
I have a query: SELECT tblCalendar.CalendarDay AS LastSunday FROM tblCalendar WHERE (((tblCalendar.CalendarDay)>=(Now()-7) And (tblCalendar.CalendarDay)...
7
by: mr.nimz | last post by:
hello, this is antenio. recently i've come to a problem. i got a way through it, somehow, still it left me in a curious state, so i'm posting it here, if i can get an answer from some techy, ...
2
by: Mark Roughton | last post by:
I have a form where the users need to view records for various criteria, one of which is a date field on which they may wish to view all related data for the selected date, for all dates upto and...
2
by: Bill | last post by:
I have a 200 record database that includes a date/time field, AnnivDate, for a wedding anniversary. AnnivDate has nulls and some incorrect year data. I have been creating the Access database...
2
by: markcarroll | last post by:
I have a rather complicating query (the SQL is about a page long) so I hope I can solve this without needing to get into specifics. Basically, the database I am working on has information about...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.