Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date subtraction question
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Date subtraction question
Miscellaneous
Thread ID:
00673986
Message ID:
00673986
Views:
69
I have the statement below and it doesn't create an error, but it doesn't "work" either. The goal is that I know when a room ends, I want to loop through a set of times, but the last loop must stop at when the room closes - the length of the possible case. So if the room closes at 1700 and the required length is 60 minutes, the last possible time should be 1600. I read the BOL and dateadd really seemed to be just for adding. The example of date subtraction in the BOL showed how to subtract a day, but not just minutes from the datetime.
set @iLength  = 60

while (@LoopDate < dateadd(mi,-@ilength,@EndDate))
Thanks
Kirk
Next
Reply
Map
View

Click here to load this message in the networking platform