Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 Other Forums
 MS Access
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

443 Posts

Posted - 10/12/2006 :  07:07:58  Show Profile  Reply with Quote
Hi am using the datediff function to get the differences between 2 dates but i like to select a range of days between these 2 date at the moment i can only do 1 day at a time i like to get between 1 and 3 days, it for repeat orders.

Here is my code
No Of Days: DateDiff("d",[Repeat_Orders ].[Created on],[Repeat_Orders_1].[Created on])

[Forms]![Sap_Prompt]![No Of Days]

I have a drop down list were i select my days from , at the moment i can only select 1 day at a time, i'd like to be able to select 3 days were is would also show me 1, 2 and 3 days of repeat orders.

Patron Saint of Lost Yaks

30421 Posts

Posted - 10/12/2006 :  07:13:36  Show Profile  Visit SwePeso's Homepage  Reply with Quote
select * from sometable where somedatetimecol between [Repeat_Orders].[Created on] and [Repeat_Orders_1].[Created on] ?
just make sure [Repeat_Orders].[Created on] is older than [Repeat_Orders_1].[Created on].

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Constraint Violating Yak Guru

443 Posts

Posted - 10/12/2006 :  07:31:55  Show Profile  Reply with Quote
Hi Peter i already have the between statement in , i use the ocxCalendar picker to pick my dates, which are in turned used in the datediff statment,

Between [Forms]![Repeat_Orders ]![cboStartDate] And [Forms]![Repeat_Orders ]![cboEndDate]

Its the picking of the days between the date i need to get as a range.

I select my 2 dates, then i need to select the number of day between the 2 dates.

F_Date 06-10-06
S_Date 10-10-06

No of days 3

I would like to show the repeat orders for 1 2,and 3 days at the moment i've a list box and if i select 1 it only shows 1 day like wise with 2,3, etc..
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000