Data type error: Clover type: integer; SQL type: TIMESTAMP

I have a sql statement in a graph that does a SQL datediff(). When trying to run, I get the following error:

Clover type: integer; SQL type: TIMESTAMP

My datediff line looks like this:

convert(integer, abs(datediff(day, convert(datetime,end_dt) ,convert(datetime,begin_dt)))) as lag

I’m specifically converting it to an integer (don’t think I should have to), but it does not work. I have also tried it without the convert, and neither method works. Is this a bug?

We are using clover 3.1 and MS SQL Server 2008.

Hello Dan,
you’re missing the t_key field in your query. Query

select
	t_key,
	begin_dt,
	end_dt,
	convert(integer, abs(datediff(day, convert(datetime,end_dt)	,convert(datetime,begin_dt)))) as lag
from t

as well as the query


select
	$begin_dt:=begin_dt,
	$end_dt:=end_dt,
	$lag:=convert(integer, abs(datediff(day, convert(datetime,end_dt)	,convert(datetime,begin_dt)))) as lag
from t

returns proper data.