Normal Topic Date Format (Read 405 times)
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Date Format
May 29th, 2007 at 4:44pm
Print Post Print Post  
I am using the following code (excerpt) to try to print the date on a cheque in a MM/DD/YYYY format as follows:

vEnd = @Left(@Month(Value),3) + "/" + @DOM(Value) + "/" + @Year(Value)

However, it produces the following:    1/27/2006

What I need is:      01/27/2006

Is this possible?

Thanks,

Louis Galvao
  

Louis Galvao
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
Reply #1 - May 29th, 2007 at 5:12pm
Print Post Print Post  
Hello Louis,

Try the following code

vEnd = @Right("00" + @Str(@Month(Value)), 2) + "/" + @Str(@DOM(Value)) + "/" + @Str(@Year(Value))

-Ray
  

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


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Date Format
Reply #2 - May 29th, 2007 at 8:15pm
Print Post Print Post  
Ray:

Thanks.  That does the trick.  I just realized that I needed this format for the day as well and inserted the @right feature to deal with this:

     vEnd = @Right("00" + @Str(@Month(Value)), 2) + "/" + @Right("00" + @Str(@DOM(Value)), 2) + "/" + @Str(@Year(Value))

Louis
  

Louis Galvao
Back to top
 
IP Logged