Greetings,
I have an existing database for a time management system with fields as follows:-
bookDate, StartTime, EndTime ALL of type datetime.
Frustratingly there is no datatype 'time' in sql server 2005.
I would like to say in T-SQL Select * from bookings b where (b.bookdate, ddmmyyyy) + (b.startTime, HH:mm) > GETDATE
Or to simplify where the date of the bookdate + the time of the startime together to form a new datetime and then select where it is greater than the current date and time.
I'm working in vb.net and my t-sql knowledge is basic.
I've working with DATEPART and DATAADD functions without success.
Can anyone suggest a way forward?
Thanks
Rob
I have an existing database for a time management system with fields as follows:-
bookDate, StartTime, EndTime ALL of type datetime.
Frustratingly there is no datatype 'time' in sql server 2005.
I would like to say in T-SQL Select * from bookings b where (b.bookdate, ddmmyyyy) + (b.startTime, HH:mm) > GETDATE
Or to simplify where the date of the bookdate + the time of the startime together to form a new datetime and then select where it is greater than the current date and time.
I'm working in vb.net and my t-sql knowledge is basic.
I've working with DATEPART and DATAADD functions without success.
Can anyone suggest a way forward?
Thanks
Rob