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

 All Forums
 Other Forums
 MS Access
 Combo

Author  Topic 

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2006-10-12 : 07:07:58
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.


SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-10-12 : 07:13:36
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

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2006-10-12 : 07:31:55
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.

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

Eg.
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
   

- Advertisement -