O'Reilly logo

Teradata SQL by Tom Coffing, Mike Larkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9 - Date Functions

“An inch of time cannot be bought with an inch of gold.”

- Chinese Proverb

 

Date, Time, and Current_Timestamp Keywords

images

Above are the keywords you can utilize to get the date, time, or timestamp. These are reserved words that the system will deliver to you when requested. The Keyword TIMESTAMP will fail. Notice the -04:00 at the end of the ANSI_Timestamp. That is the time zone offset. This system is 4 hours behind Greenwich Mean Time (GMT).

 

Dates are stored internally as INTEGERS from a Formula

INTEGERDATE = ((Year – 1900) * 10000) + (Month * 100) + Day

/* Example – Tom's Birthday January 10, 1959 */

/* Example ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required