Discussion Board for collaboration related to Creating Analytics for QlikView.
I'm hitting an error in Teradata as invalid timestamp (SqlState: S1000, ErrorCode: 4294960536, ErrorMsg: [Teradata][ODBC Teradata Driver][Teradata Database] Invalid timestamp.)
Below is the script.
Max:load *; SQL select Max(MODIFIED_DATE) AS Afrom TABLE1 WHERE ACTIVE_FLAG='N';
let maxDate= Timestamp(Peek('Max',0,'A'));
Drop Table Max;
from TABLE1 WHERE ACTIVE_FLAG='Y' OR (ACTIVE_FLAG='N' AND MODIFIED_DATE>= cast ('$(maxDate)' as TIMESTAMP(0) FORMAT 'MM/DD/YYYYBHH:MIS')) AND MANUAL_FLAG='Y';
Please suggest what's going wrong here.
Thanks in advance
Are you sure that
cast ('$(maxDate)' as TIMESTAMP(0) FORMAT 'MM/DD/YYYYBHH:MIS'))
is valid SQL expression?
As I rememeber you are not allowed use Qliikview variables in SQL statement.
There's no difference without it too as i felt TIMESTAMP() would be fine and tried but there's no difference.
Does you query work without MODIFIED_DATE>= cast ('$(maxDate)' as TIMESTAMP(0) FORMAT 'MM/DD/YYYYBHH:MIS')) expression?
Yes.It's working fine without that statement.
The problem in using Qlikview variable in SQL statement.
Just load data without this condition, than Reload table using this condition.
Hope this helps.