Page 1 of 1

Fetch records based on date range from reference table

Posted: Tue Dec 09, 2008 8:04 pm
by Shruthi
Hi.. I have the following scenario.

In the source, I have a date field named VALID_D.

In the reference DB2 table, I have the following columns CURRENT_DATE, FROM_DATE and TO_DATE. Primary key is CURRENT_DATE. We have entry for every day for 5 years.

I have to check if the VALID_D from source is between FROM_DATE and TO_DATE for current date.

How can this be achieved?

For now, am using a transfomer and generating a new column with current date value and then, using lookup, comparing the newly generated column and CURRENT_DATE.

Is there any stage in DS which can be used to check if the records fall between two date range?

Posted: Tue Dec 09, 2008 9:26 pm
by ray.wurlod
Not until you get version 8.0 or later.

Thanks

Posted: Tue Dec 09, 2008 10:01 pm
by Shruthi
Thanks Ray. As the feature was available in other ETL tool and as am new to datastage, was wondering if there is such thing in Datastage also. Thanks agian.