Page 1 of 1

Compare the two dates which is Greater

Posted: Thu Oct 12, 2006 3:56 am
by boppanakrishna
hi all,
I have two source files , one is main source which contains columns like "sno","Date",and the other file contains only one column "ADate",
now i want to compare the "Date " column from first source with the "ADate" , and if the Date of " Date" column in first file is greater than the date of "Adate " then only i should pass it into the target ...


Thanks in Advance
Boppana Krishna

Posted: Thu Oct 12, 2006 4:01 am
by ray.wurlod
There are several ways to solve this. Do you have any ideas about how you wish to proceed? For example, is the comparison to be performed row by row?

Posted: Thu Oct 12, 2006 5:44 am
by boppanakrishna
hi Ray,
My second Dataset contains only one Date and based upon that date only i should pass the values to the target ,could you please tell me the stages to use also

Thanks,
Boppana

Posted: Thu Oct 12, 2006 5:54 am
by Kirtikumar
What do you mean by based upon that date?

Does this mean - if the Date coming from second dataset is null then pass it or if it is equal to current date then pass it?

It is diff to get anything from the what you are saying. Can you please mention what is your condition on which record should be passed to target :?:

Posted: Thu Oct 12, 2006 7:32 am
by boppanakrishna
hi keerthi,
i will pass only the dates which are greater of the two dates to the target

Thanks
Boppana Ramakrishna

Posted: Thu Oct 12, 2006 7:43 am
by dsdev750
In the first job, you could read the dataset first and pass the date to a second job as a job parameter(vDateParam). In the second job, use a transformer and a constraint to only let those records through where incoming date is > vDateParam.

Posted: Thu Oct 12, 2006 7:49 am
by chulett
Make sure your dates are in an ISO format, then a simple compare will work: YYYY-MM-DD or YYYYMMDD, for example.

Posted: Thu Oct 12, 2006 2:20 pm
by ray.wurlod
You can do it in one job. Perform the full outer join, then use a downstream Filter stage to constrain the rows passed through. I needed to be certain of what you needed to do.

Posted: Thu Oct 12, 2006 2:26 pm
by ambasta
I think you can do this by converting your fields as datetosting or timestamptoString and then compare themn.I think this will work