Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

convert date format

Dear friends,

how can convert the date 006.2010 in 30/06/2010??

in the table there is the period 006.2010 and I want convert in script to date 30/06/2010 and then manage this one in master calendar

can you help me

regards

gennaro

4 Replies
Not applicable
Author

I done in this way:

Directory; CO_PA: LOAD

MonthEnd(makedate((right(Periodo, 4)), (left(Periodo, 3)))) as Data,



//Calendar

LET varMinDate = Num(Peek('MinDate'));

LET varMaxDate = Num(Peek('MaxDate'));

LET vToday = num(today());

DROP TABLE MaxMinDate;

//*************** Temporary Calendar ***************

TempCalendar:

LOAD

$(varMinDate) + rowno() - 1 AS Num,

date($(varMinDate) + rowno() - 1) AS TempDate

AUTOGENERATE $(varMaxDate) - $(varMinDate) + 1;

//*************** Master Calendar ***************

MasterCalendar:

LOAD

TempDate AS Data,

Year(TempDate)as Anno,

Month(TempDate) as Mese,

Week(TempDate) as Settimana,

'Q' & Ceil(Month(TempDate)/3) as Quarter



but there's this error:

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Can you explain a bit more how the period maps to the date? Is the period "006" month 6 and you want the monthend as date? Do you have 12 periods 1-12?

-Rob

Not applicable
Author

Hi Rob,

yes, all rigth

'006' is month 6 (june)

I want monthend 30/06/2010 and I have 12 period

thanks in advance

Anonymous
Not applicable
Author

Hi, is that what you mean?

=MonthEndDate( Date#( '006.2010', '0MM.YYYY' ) ) )