Bind Variable and date manipulation

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
abha.kalra
Participant
Posts: 37
Joined: Fri Oct 21, 2005 4:09 am

Bind Variable and date manipulation

Post by abha.kalra »

Hi ,

I have a teradata query

Select Col1,Col2,Col3
From
Tablename
Where DayDt= CurrentDate-364 /** get a year back date from the current date**/

As current date will keep on changing .I replaced the above query in ODBC stage to provide the date at run time

Select Col1,Col2,Col3
From
Tablename
Where (DayDt=?-364)

The ouput it coming as 1900-00-00 . I understand in datastage I can't do the date caculation on the dates, however this is done in query passed to teradata. Please give thoughts on how to get the correct date.

Thanks,
Abha
Thanks and Regards
Abha
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create a new field of type date and marked as Key. Derive the value as CurrentDate() - 364. Supply this as the value to the database stage, and use Where (DayDt=?)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply