Last calender date
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 48
- Joined: Sat Oct 22, 2005 9:56 am
Last calender date
Hi
I have to populate "last calendar date" in end_date column
Source : Varchar
Targget : Date
I am doing in the below way
END_DATE[1,4]:'-':MonthFromDate(END_DATE)+1:'-':01 SvarDt1
JulianDayFromDate(SvarDt1)-1 SvarDt2
DateFromJulianDay(SvarDt2 Svardt3
End_date=Svar3
I am getting the follwoing errors
APT_CombinedOperatorController,0: Invalid character conversion found converting to ISO-8859-1, substituting.
Un-handled conversion error on field "START_DATE " from source type "date" to destination type "raw[7]":
When i took the stagevariable values to peek stage i am getting like "SvarDt1:2008/2/1 SvarDt2:-1 Svardt3:093-02-27 "
Could you please help me out in solving this
Regards,
Sateesh.M
I have to populate "last calendar date" in end_date column
Source : Varchar
Targget : Date
I am doing in the below way
END_DATE[1,4]:'-':MonthFromDate(END_DATE)+1:'-':01 SvarDt1
JulianDayFromDate(SvarDt1)-1 SvarDt2
DateFromJulianDay(SvarDt2 Svardt3
End_date=Svar3
I am getting the follwoing errors
APT_CombinedOperatorController,0: Invalid character conversion found converting to ISO-8859-1, substituting.
Un-handled conversion error on field "START_DATE " from source type "date" to destination type "raw[7]":
When i took the stagevariable values to peek stage i am getting like "SvarDt1:2008/2/1 SvarDt2:-1 Svardt3:093-02-27 "
Could you please help me out in solving this
Regards,
Sateesh.M
Rather than make people puzzle out and guess what you mean by "last calendar date" why not provide specific examples so it hopefully becomes clearer? For example, show an "END_DATE" value and what it should be transformed into as a "last calendar date".
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 48
- Joined: Sat Oct 22, 2005 9:56 am
-
- Participant
- Posts: 34
- Joined: Mon May 05, 2008 1:31 am
Last Calender Date
Hi Sateesh,
For last month last date use this follwing logic:
DateFromJulianDay(JulianDayFromDate(CurrentDate()) - CurrentDate() [9,2])
For last month last date use this follwing logic:
DateFromJulianDay(JulianDayFromDate(CurrentDate()) - CurrentDate() [9,2])
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
How about a simple expression to generate the last day of the month (perhaps in a stage variable), and build the new date from that? Don't forget to handle leap year (perhaps a separate stage variable).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.