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