Date guerying in Teradata SQL Assistant

General
General covers Articles, Reference documentation, FAQs, Downloads and Blogs that do not belong to a specific subject area. General-purpose Articles about everything and anything
New Member

Date guerying in Teradata SQL Assistant

Hi,

 

I am new to Teradata and having hard time on doing queries with date in the where clause. Apparently it does not work similarly as for example in Oracle SQL.

 

I am querying a view. There is column called Register_Date and the format [DATE].

When I select * the date looks like this for example: 15.1.2018.

But when I put that into a where clause it gives me error: SELECT Failed [3535] A character string failed conversion to a numeric value.

 

I have tried to put (Date) in front and afterwards but it keeps giving me the same error.

 

SELECT    *
        
FROM DX_VIEWS.CUSTOMER_DIM

where  Register_Date = '15.1.2018'

Could someone help me with this one?

 

Br

 

1 REPLY 1
Ambassador

Re: Date guerying in Teradata SQL Assistant

There's only one recommended date format using a Standard SQL date literal:

date '2018-01-15'

The date returned by SQL Assistant is formatted locally, you should change it to YYYY-MM-DD:

Tools > Options > Data Format > Display dates in this format