Timestamp in where clause

21,177

You currently calculate 1 divided by 1 divided by 2105 and get a syntax error complaining about the following 13 :-)

There's only one recommended way to write a TIMESTAMP, using a Standard SQL literal, the keyword TIMESTAMP' followed by a string with 'YYYY-MM-DD HH:MI:SS' format:

Where SCAN_TIME > TIMESTAMP '2015-01-01 13:11:00'

Similar literals exist for date & time:

DATE '2015-01-01'
TIME '13:11:00'
Share:
21,177
ASuit
Author by

ASuit

Updated on April 28, 2020

Comments

  • ASuit
    ASuit about 4 years

    In my Teradata Query I want to do something like this. But its not working-

    Select *
    
    Where SCAN_TIME > 01/01/2015 13:11:00
    

    My SCAN_TIME column is a TIMESTAMP(0) field with data as shown above. How should I go about doing this?