Page 1 of 1

Bind Variable and date manipulation

Posted: Mon Mar 22, 2010 9:03 pm
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

Posted: Mon Mar 22, 2010 9:17 pm
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=?)