Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DATETIME Question
Message
From
05/01/2006 15:26:17
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01083372
Message ID:
01083774
Views:
13
>Ok. How would I use DATEDIFF in the following SQL? I want to test to
>see if a specified date falls in a certain range of dates
>
>
>
>SELECT *;
> FROM MyTable;
> WHERE BETWEEN(MyDate, dStartDate, dEndDate)
>
>

of course, dStartDate, dEndDate are metadata
SELECT *;
 FROM MyTable;
 WHERE datediff(d,dStartDate,getdate()) 
            between 0 and datediff(d,dStartDate,dEndDate)
Previous
Reply
Map
View

Click here to load this message in the networking platform