Invalid Timestamp

Database
Enthusiast

Invalid Timestamp

Hi Gurus,

I have a requirement where i need to know what all sessions run between a particular timestamp which is input by user. The query below is throwing invalid timestamp error.

My database version is :Teradata 14.10.0104  14.10.01.04

SEL J.WKFLW_NAME, J.SESSION_NAME, J.STRT_TM,J.END_TM

FROM G_D_P_BV.G_D_ETL_JOB_RUN_DTL J

INNER JOIN

G_D_P_BULK_V.CDR_G_WORKFLOW_RUN_DETAIL W

ON J.WKFLW_NAME=W.WORKFLOW_NAME

where

J.WKFLW_NAME='wflw_G_TC_STAGE'

and

CAST(J.STRT_TM AS timestamp(6) FORMAT 'MM/DD/YYYYBHH:MI:SS') 

BETWEEN 

CAST('?workflow_start_time' AS timestamp(6) FORMAT 'MM/DD/YYYYBHH:MI:SS')

AND

CAST('?workflow_end_time' AS timestamp(6) FORMAT 'MM/DD/YYYYBHH:MI:SS')

group by 1,2,3,4

Regards,

Amit

Tags (1)
2 REPLIES
Enthusiast

Re: Invalid Timestamp

Hi All,

I got hold of that issue in a different way, but can anyone please tell me what is the issue here?

Regards,

Amit

Junior Supporter

Re: Invalid Timestamp

The 'issue' is that the user is providing a bad timestamp, wrong format or whatever.

There is nothing wrong in the SQL (apart from the fact that there is a discrepance between the timestamp(6) and the format required -timestamp(0)- ).

Cheers.

Carlos.