Teradata Enterprise Stage : Timestamp issue in Where conditi

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Sreedhar
Participant
Posts: 187
Joined: Mon Oct 30, 2006 12:16 am

Teradata Enterprise Stage : Timestamp issue in Where conditi

Post by Sreedhar »

Source - Teradata
Target - Seq File

Bkgrnd - Job successfully executes when a Date field is used in where condition. However whenever I use a Timestamp(0) field in where condition it errors out. The where condition is passed through a parameter

Tried all these :
WHERE A.ORD_TS BETWEEN '2011-04-10 00:00:00' AND '2011-04-11 00:00:00'
WHERE A.ORD_TS>='2011-04-10 00:00:00' AND A.ORD_TS<'2011-04-11 00:00:00'
WHERE A.ORD_TS>=cast('2011-04-10b00:00:00' as timestamp(0))
WHERE A.ORD_TS>=cast('2011-04-10' as timestamp(0))
WHERE A.ORD_TS>=cast('2011-04-10 00:00:00' as timestamp(0))
WHERE A.ORD_TS>=1090401 AND A.ORD_TS<1090501
WHERE ORD_TS>= '2009-04-11b03:00:00' AND ORD_TS< '2009-05-11b03:00:00'
WHERE ORD_TS>= current_timestamp - interval '300' day AND ORD_TS< current_timestamp - interval '275' day

But failed.

However, when I use the below where condition as a hardcoded value in user defind sql it works -
WHERE A.ORD_TS>='2011-04-10 00:00:00' AND A.ORD_TS<'2011-04-11 00:00:00'

How can we make it work with the parameter?
Regards,
Shree
785-816-0728
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Escape the quotes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply