Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Script error (Invalid timestamp in Teradata

Hi All,

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 A
from TABLE1 WHERE  ACTIVE_FLAG='N';

let maxDate= Timestamp(Peek('Max',0,'A'));

Drop Table Max;

TBL:

Load*,

Sql select

Field1,

Field2,

Field3

from TABLE1 WHERE  ACTIVE_FLAG='Y' OR  (ACTIVE_FLAG='N' AND MODIFIED_DATE>= cast ('$(maxDate)' as TIMESTAMP(0) FORMAT 'MM/DD/YYYYBHH:MISmiley FrustratedS')) AND MANUAL_FLAG='Y';

Please suggest what's going wrong here.

Thanks in advance

5 Replies
crusader_
Valued Contributor

Re: Script error (Invalid timestamp in Teradata

Hi,

Are you sure that

cast ('$(maxDate)' as TIMESTAMP(0) FORMAT 'MM/DD/YYYYBHH:MISmiley FrustratedS'))

is valid SQL expression?


Edit:

     As I rememeber you are not allowed use Qliikview variables in SQL statement.


Kind regards,

Andrei

Not applicable

Re: Script error (Invalid timestamp in Teradata

There's no difference without it too as i felt TIMESTAMP() would be fine and tried but there's no difference.

crusader_
Valued Contributor

Re: Script error (Invalid timestamp in Teradata

Does you query work without MODIFIED_DATE>= cast ('$(maxDate)' as TIMESTAMP(0) FORMAT 'MM/DD/YYYYBHH:MISmiley FrustratedS')) expression?

Not applicable

Re: Script error (Invalid timestamp in Teradata

Yes.It's working fine without that statement.

crusader_
Valued Contributor

Re: Script error (Invalid timestamp in Teradata

The problem in using Qlikview variable in SQL statement.

Just load data without this condition, than Reload table using this condition.

Hope this helps.

Andrei

Community Browser