Page 1 of 1

Date Range Validation

Posted: Wed Mar 31, 2010 3:24 am
by nani0907
hi,

I need to check wthether the Effective date is in between the Start date and end date cloumn. here is the example.

Eff date Start Date End date
20091231 20081231 20111231

20071231 20081231 20111231

For the above records, i need to pick up the first record as Eff date is beetween the start date and End date. my source is file . how check the range ttrougt the transformer stage.

Thanks in Advance

Posted: Wed Mar 31, 2010 3:33 am
by ArndW
Since your date format is YYYYMMDD you can use straightforward string/numeric checks for values greater than a less than, i.e.

Code: Select all

IF In.EffDate > In.StartDate AND In.EffDate < In.EndDate THEN 'Good' ELSE 'Bad'

Posted: Wed Mar 31, 2010 3:47 pm
by ray.wurlod
When you generate test data, you need to construct expected results which you compare with actual results.

Can you please describe the expected results for your two examples?

I suspect Arnd's partial solution will get you most of the way there, but that you require not "Good"/"Bad" as the output but, rather, the beginning date of the period. This is no big deal to change the expression, but I need to be confident that you have fully specified the requirement.

Otherwise all that typing has been a waste of time.