Infolink

 

Search This Blog

Mar 19, 2014

Date field in the format of D D M M Y Y Y Y in Crystal Report

The default format gives me the date as ddmmyyyy I need to figure out a way to print the date in the format of D D M M Y Y Y Y.

 


To achieve this i need create a new formula field.

Now lets look at the formula.

totext({YourDateFieldHere}, "ddmmyyyy")

Then create a new formula and paste the following

mid({@formulaDate},1,1)&" "&mid({@formulaDate},2,1)&"
"&mid({@formulaDate},3,1)&" "&mid({@formulaDate},4,1)&"
"&mid({@formulaDate},5,1)&" "&mid({@formulaDate},6,1)&"
"&mid({@formulaDate},7,1)&" "&mid({@formulaDate},8,1)

explanation for mid function

Local StringVar x :=totext(Currentdate, "
ddmmyyyy")
Local StringVar y;

//Start at position 2, go to the end of the string

y := Mid (x, 2); //y is now "9032014"

//Start at position 2, extract 1 character

y := Mid (x, 2, 1) //y is now "9"

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...