Date values

General
Enthusiast

Date values

Hello,
I've created a separate table with just date: i.e. "12/16/2010 5:05:12.193100 AM" named as max_dt considered to be a max date in the last run. When the new job starts, it should read this date and extract data greater than this date.
The question is: How this table can be plugged in into the existing query. Any help would be great.
Thanks
3 REPLIES
WAQ
Enthusiast

Re: Date values

You can use subquery to get the max date from this table and compare it in your actual query.

Re: Date values

If "12/16/2010 5:05:12.193100 AM" is timestamp, then use the below in where clause:

WHERE date > ( select max(cast(timestamp as DATE) from table);
Enthusiast

Re: Date values

Thank you. The query worked great. I didn't know teradata allows sub-query this way......