Professional Documents
Culture Documents
Web w
Library
White Papers
Dates, Times and Timestamps in
Teradata
UDFs (thru TD12)
Written by Geoffrey Rommel
Teradata PDFs
IBM PDFs
Dates, times, and timestamps in Teradata can be a little tricky.
This document explains how to do various things that you may
Quick Reference want to do. It is current through TD 12.
Rules of Conduct
FAQs Preliminaries
Join the Forum The examples below use Teradata syntax, so they assume that
you are running in BTEQ. If you are using SQL Assistant
(Queryman), be sure to uncheck the option box "Allow use of
ODBC SQL Extensions in queries". Changing the Date Time
Archives Format in your ODBC data source to AAA or IIA may also help.
2010 2004
2009 2003
2008 2002
Defining columns and formats
2007 2001
Times and timestamps can be defined with any number of
2006 2000 decimal places from 0 to 6 (time(0), timestamp(6), etc.). As it
2005 1999 turns out, however, MP-RAS on Intel doesn’t keep track of
anything beyond 2 decimal places (hundredths of seconds), so in
many cases it is useless to define columns with more than
2 decimal places. If, however, you are loading data from another
server, that data could have digits down to the microsecond.
The formats for all columns are described in the SQL Reference:
Data Types and Literals, Chapter 9. In V2R5 and later releases,
you can specify many different formats for time and timestamp
fields.
Dates
Literals