I am trying to use date flow variables in the SQL for a DB Table Selector node. My flow variables are Date types on the output port of the Table Row to Variable node but are presented as strings in my DB Table Selector node. When using the two flow variable in the SQL I get "ERROR: Operator does not exist: date >+ integer. "
Is there a way to force my flow variables back into the Date type?
The correct statement should end up being: where "TimeOffDate" between '2021-08-08' and '2021-08-13'
So, in order to reflect the above, you need to change your query to this:
SELECT * FROM "public"."Timeoff"
where "TimeOffDate"
between '$${SWeek Ending Date_Start}$$'
and '$${SWeek Ending Date}$$'
Also, the error message kind of give you a hint about the issue:
And between ... and ... statement is essentially treated as >= ..... <= .... and since 2021-08-08 is not enclosed in quotes, it’s actually being treated as a subtraction, and is literally calculating 2021-08-08 = 2005, so it’s trying to compare TimeOffDate, which is a date column, to the integer 2005, hence why the error message complains about “date >= integer”