Hi All,
I need help in compare two date fields in datastage parallel job transformer stage
Both the start date and end date fileds are NULLABLE NO yes fields.
Example
================
start date :2015-12-20
End date :2015-09-19
I just want to know whether start is greater than End date in datastage transformer
Date comparsion in transformer
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Date comparsion in transformer
if start_date and end_date datatypes are DATE then in transformer convert both date fileds to days then you can comapre both of them
take 3 stage variables
1.SvStartDate: JulianDayFromDate(lk.start_date)
2.SvEndDate: JulianDayFromDate(lk.end_date)
3. CALC: if SvStartDate > SvEndDate then 'X' Else 'Y'
take 3 stage variables
1.SvStartDate: JulianDayFromDate(lk.start_date)
2.SvEndDate: JulianDayFromDate(lk.end_date)
3. CALC: if SvStartDate > SvEndDate then 'X' Else 'Y'
If "start_date" and "end_date" are both DATE datatypes then no conversion is necessary in order to compare them.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>