What version of Kaseya and SD are you using
Kaseya 6.3 and SD 1.4
or Kaseya 6.2 and SD 1.3 ?
The Datediff command needs to look like something like this :
select DATEDIFF (minute, [=StartTime=], [=EndTime=])'
ie , when you use the Start and End times they must be entered as variables which you have previously got from earlier steps