-1
 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...

Nobody
  • 549
  • 1
  • 10
  • 24

1 Answers1

0

This is a workaround more than a answer. It is existing issue with DbFit. See https://github.com/dbfit/dbfit/issues/284 for more details

Nobody
  • 549
  • 1
  • 10
  • 24