Normal Topic Date Format in a report (Read 382 times)
esgage
Junior Member
**
Offline


No personal text

Posts: 55
Joined: Dec 8th, 2005
Date Format in a report
Jan 30th, 2006 at 2:41pm
Print Post Print Post  
I am writing a report and would like the header to show the current date the report is run. I saw that you can add a value and then run a program to add the “@date” function. However, when the report is run, the date is formatted as “YYYY/MM/DD” I would like this to be shown as “MM/DD/YY.” Is there as simple way to accomplish this?

Any help would be appreciated.

Thanks,

Kevin

E & S Gage
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Date Format in a report
Reply #1 - Jan 30th, 2006 at 2:49pm
Print Post Print Post  
Hello Kevin,

In Global code of the report put the following function
Code
Select All
Function FormatDate(Value as String) As String
Var vEnd as String

	vEnd = @Str(@Month(Value)) + "/" + @Str(@DOM(Value)) + "/" + @Str(@Year(Value))

	Return vEnd
End Function 



Then change the code in your header element on Print event to the following
Code
Select All
HeaderElement = FormatDate(@Date) 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
esgage
Junior Member
**
Offline


No personal text

Posts: 55
Joined: Dec 8th, 2005
Re: Date Format in a report
Reply #2 - Jan 30th, 2006 at 6:13pm
Print Post Print Post  
Ray:

Thank you very much!

It worked just like I wanted.

Kevin
  
Back to top
 
IP Logged