Ok – I’ve asked a few people and there has got to be an easy way to do this….
declare @Date date
declare @Time time
declare @datetime datetime
select @Date = convert(Date,GetDate())
select @Time = convert(Time,GetDate())
select @Date, @Time, @Date + @Time (+ operator fails!)
Do I really have to:
1) convert to a string, then convert to datetime field?
2) use DateAdd and DatePart to add hours first then minutes, then seconds…..
In SQL Server 2012 and I assume SQL Server 2014 you neeed to cast both the date and the time variable to datetime.