Compare Date

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
rafidwh
Participant
Posts: 179
Joined: Mon Oct 10, 2005 11:30 pm

Compare Date

Post by rafidwh »

Hi All,

I need to compare the input date which is in yyyymmdd format with the date which is passed as a parameter also in yyyymmdd.

my condition is if in.date > par.date then 0 else in.date

Please give the options to get the result
Regards,
Rafidwh
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is the input date a date or a string? If it's a string, and the parameter is a string, you can compare them directly. If one is a date and the other is a string, then you need to convert one or the other so that the data types are compatible for comparison.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rafidwh
Participant
Posts: 179
Joined: Mon Oct 10, 2005 11:30 pm

Post by rafidwh »

The input is in dd/mm/yyyy , if it valid then iam converting it into yyyymmdd using DatetoString(StringtoDate) function and then it is compared with yyyymmdd (parameter value)
Post Reply