SELECT AgentId, StartTime,
EventTo = dateadd(hh,datepart(hh,StartTime)+1,convert(datetime,convert(varchar,StartTime,112 ))),
EndTime
from [stage].[Agent]
where EndTime is not null and StartTime is not null
The above line will produce an error when I run within a tool called DbFit, however it will run successfully in SSMS.
An expression of non-boolean type specified in a context where a condition is expected, near 'EndTime'.
The only way to reproduce the error in SSMS is as follows:
SELECT AgentId, StartTime,
EventTo = dateadd(hh,datepart(hh,StartTime)+1,convert(datetime,convert(varchar,StartTime,112 ))),
EndTime
from [stage].[Agent]
where EndTime
Any ideas as to what is the issue and how to resolve it...