A request to return a specific date from a teradata timestamp (6)

How can I find a specific date, for example: "2013-10-22" from the teradata timestamp (6) field?

sel * from table A
where date = '2013-10-22';

I tried the above query, which throws an error. Please, help!

+4
source share
3 answers

You can try the following: -

sel * from table A
where date = date '2013-10-22';

Since in standard ANSI form (must be preceded by the DATE keyword)

Check out this

+4
source

Something like that:

where YourTimestampField >= {d '2013-10-22'}
and YourTimestampField < {d '2013-10-23'}
0
source

:

select * 
from table A
where cast(timestamp_column as date) = date '2013-10-22';

I assume that you just showed an example, because I don’t think you might have a column with a name date; it is a reserved word. The keyword " date " is indicated above, since you specify an ANSI date constant and are not related to the "date" function.

0
source

All Articles