Page 1 of 1

Last calender date

Posted: Wed Sep 03, 2008 1:15 pm
by sateeshbabu
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

Posted: Wed Sep 03, 2008 1:41 pm
by chulett
:idea: 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".

Posted: Wed Sep 03, 2008 1:46 pm
by sateeshbabu
Chulett,

Thanks for the reply.

I have to populate last calendar date of the month that i am getting from input.

For Exapmple Input record is 2008-12-27 then need to popultae '2008-12-31' in end_date column.

Regards,
Sateesh.M

Posted: Wed Sep 03, 2008 2:06 pm
by chulett
Do an Exact search on "month end date" in the PX forum.

Posted: Mon Dec 08, 2008 2:07 am
by fareeda_b
Hi Sateesh,

Could you please explan how your doing this Last calender date function logic ?

thanks
fareeda

Posted: Mon Dec 08, 2008 2:08 am
by fareeda_b
Hi Sateesh,

Could you please explan how your doing this Last calender date function logic ?

thanks
fareeda

Last Calender Date

Posted: Mon Dec 08, 2008 3:21 am
by hemanthakumar
Hi Sateesh,
For last month last date use this follwing logic:
DateFromJulianDay(JulianDayFromDate(CurrentDate()) - CurrentDate() [9,2])

Posted: Mon Dec 08, 2008 3:39 am
by fareeda_b
Hi hemantha kumar,

need clarification on last calender date if i want 2008-12-31 date .

could you please explan me how it will resolve this.


thanks
fareeda

Posted: Mon Dec 08, 2008 3:58 pm
by ray.wurlod
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).