I'd like to be able to do something like this:
insert into mydb.mytable (updatetimestamp) values (#1/15/2012 01:03:00#)
...or...
select * from mydb.mytable where updatetimestamp = #1/15/2012 01:03:00#
Using literals wouldn't required the longwindedness of casting and whatnot since it would immediately interpret the expression as a DATE or TIMESTAMP.
Does Teradata support this type of syntax?
By default, For ANSI dates, Teradata follows the date format as YYYY-MM-DD, whereas for the integer dates, the default date format is YY/MM/DD.
The Teradata RDBMS stores the date in YYYMMDD format on disk. The YYY is an offset value from the base year of 1900. The MM is the month value from 1 to 12 and the DD is the day of the month. Using this format, the database can currently work with dates beyond the year 3000.
Yes, Teradata supports the ANSI format for dates and timestamps. Reference: http://www.teradataforum.com/l070316a.htm
For example:
INSERT
INTO mydb.mytable (updatetimestamp)
VALUES (TIMESTAMP '2012-01-15 01:03:00');
Or:
SELECT *
FROM mydb.mytable
WHERE updatedate = DATE '2012-01-15';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With