cancel
Showing results for 
Search instead for 
Did you mean: 

Date Conversion

Former Member
0 Kudos

Hi

I am using below formula for report heading

"Analysis Data "&"("&{?ef}&"-"&{?et}&")"

The o/p is Analysis Data(1/1/2007 -12/31/2008)

but i want to dispaly like Analysis Data(1-Mar-07 - 12-Dec-08)

How to convert the dates in formula/

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Thanks for your response

I used this formula

"Analysis Data"&"(" &DatePart("d",{?ef})&"-"&MonthName(DatePart("m",{?ef}))&"-"&DatePart("yyyy",{?ef})&"-"

&DatePart("d",{?et})&"-"&MonthName(DatePart("m",{?et}))&"-"&DatePart("yyyy",{?et})&")"

so i am getting o/p like

Analysis Data ( 1 . 00 - January - 2 , 007 . 00 - 31 . 00 - December - 2 , 008 . 00 )

but i want Analysis Data ( 1-jan-07 -31-dec-08)

means date should be 1 rather than 1.00

month should be jan rather than january

year shouls be 07 ratherthan 2,007.00

Thank you

former_member207342
Contributor
0 Kudos

This gives exact format you looking for

ToText(CDate(DatePart("yyyy",CurrentDate), DatePart("m",CurrentDate), DatePart("d",CurrentDate)), "dd-MMM-yy")

e,g: 02-Dec-08

Edited by: Kuldeep Chitrakar on Dec 22, 2008 10:50 AM

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

Thanks, My problem is solved.

former_member207342
Contributor
0 Kudos

To get the date in your format use following formula

DatePart("d",CurrentDate)&"-"&MonthName(DatePart("m",CurrentDate))&"-"&DatePart("yyyy",CurrentDate);

--Kuldeep

Former Member
0 Kudos

Hi

I don't want to show the difference between dates.

i want to attached the dates to report heading.

i want show dates but in different format.

i want to change date format from 1/1/2007 to 1-mar-07.

Thanks

former_member207342
Contributor
0 Kudos

Instead of conversion function you can use following formula for date diff

Local DateTimeVar d1 := {Customer_Payment.Date1};

Local DateTimeVar d2 := {Customer_Payment.Date2};

DateDiff ("yyyy", d1, d2) ;

let me know if it solves your problem

-- Kuldeep