Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Dates??

Status
Not open for further replies.

Shoot

Programmer
Oct 11, 2003
31
0
0
US
Hi,
I created reports using dynamic date condition objects as per the report requirements. We ar using "Teradata."
Everything was working fine but recently the it seems the function is not working fine. When I try to use it, it doesn't retrieve any values for the date. When i hard code the date like '2003-12-31' I am able to retrieve data but When I use the Condition object it doesn't retrieve data for certain values. That means if change the value "(-3)" in the code to anyother for some dates the data is retrieved but for some it doen't retrieve any data even if we have data in the tables.

Any Ideas?? I am using Add_months() function to calculate dates.

WHERE
(
DATE=Add_Months((DATE-EXTRACT(DAY FROM DATE)),(-3))
)

Thanks in Advance,
Shoot
 
Maybe some records have a time part in the date as well. Ie 12-05-2004 is recognized and retrieved but 12-05-2004 09:03:25 not. Try trunc to the date part of the date. In Oracle you could use trunc(datefield).
 
One more thing is the name on the left hand side of the Condition... In Teradata Date is going to give us the CurrentDate so shouldn't you be having a column name there instead...

Sri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top