Jumping into SQL with EntityWhereString, I was trying to do some date arithmetic. I had a timestamp and an integer number of days. I wanted to add the number of days to the timestamp and work with the resulting timestamp.
the Postgresql syntax for this is
SELECT timestamp '2001-09-28 01:00' + interval '23 hours' from myReports
so I got this far:
select tx_stamp + interval '23 days' from myReports
and that worked but when I tried using my integer column "days_to_complete" for the interval, the syntax wasn't clear.
It turns out I needed to concatenate cast my days_to_complete into a string:
and then cast the resulting string into an INTERVAL:
select tx_stamp + (days_to_complete||' days')::INTERVAL from myReports
and that worked.