Hi
I've been working on a flow in PAD that firstly opens a dialog with two dates in it. it then opens sql and uses these two variables in a SQL Query to create a table. The variables seem to come out with the correct data, and if I paste the results directly into a SQL Query it works. If I try it within the flow I get this error
Error in SQL statement The statement has been terminated.
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
The SQL statement in the flow is as follows:
select job,clockindate
into TBL_001
From TBL_002
WHERE (ClockInDate > CONVERT(DATETIME, '%SelectedDate%', 102) AND ClockInDate < CONVERT(DATETIME, '%SecondSelectedDate%', 102))
like I say if I uses the variable results directly in sql it works 😞 any ideas ??
Solved! Go to Solution.
changed to this and all works 😄
WHERE (ClockInDate > CONVERT(DATETIME, '%SelectedDate%',103) AND ClockInDate < CONVERT(DATETIME, '%SecondSelectedDate%',103))
changed to this and all works 😄
WHERE (ClockInDate > CONVERT(DATETIME, '%SelectedDate%',103) AND ClockInDate < CONVERT(DATETIME, '%SecondSelectedDate%',103))