Assuming we have 3 fields, Datetime, ID and some value, and DBConnect doesn't want work with ID for some reason, then :
SELECT cast(DATEDIFF(s, '1970-01-01 00:00:00.000', Datetime ) as bigint) as MyNewID,
ID,
Datetime,
Some Value
where <some conditions>
then Try MyNewID instead of ID in DB Connect.
... View more