Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Querying Dates
Message
From
12/07/2007 16:35:53
 
 
To
12/07/2007 16:09:37
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01239895
Message ID:
01239909
Views:
14
Hi, Bob,

There are several ways to handle this...one way might be to add one day to the 2nd parm, and use "less than". (obviously, you want to make sure both parms are purely date, with a time of midnight)
SET @EndDate = DATEADD(@EndDate,1)    
SELECT * from MyTable WHERE date >= @StartDate AND date < @EndDate
Note, I didn't verify the syntax for DateAdd, I don't have SQL open right now, so if it doesn't work, check the syntax in BOL.

Kevin
Previous
Reply
Map
View

Click here to load this message in the networking platform