Former Member

# Date Conversion

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

10|10000 characters needed characters exceeded

### Related questions

Former Member
Posted on Dec 22, 2008 at 09:37 AM

Hi

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

10|10000 characters needed characters exceeded
• 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

• Posted on Dec 22, 2008 at 08:45 AM

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

10|10000 characters needed characters exceeded
• Former Member
Posted on Dec 22, 2008 at 08:57 AM

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

10|10000 characters needed characters exceeded
• Posted on Dec 22, 2008 at 08:59 AM

To get the date in your format use following formula

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

--Kuldeep

10|10000 characters needed characters exceeded
• Former Member
Posted on Dec 22, 2008 at 10:20 AM

Hi

Thanks, My problem is solved.