Date format
Posted: Thu May 07, 2009 9:42 am
Hi,
I need to convert the '04/01/2009' date in string format to '4/1/2009'.
Basically, i need to trim out the leading zeros using Trim functions.
Output will be 4/1/09.
Instead of using this lengthy code can we convert the source string to date and then back to string to get just as '4/1/09'. Or please let me know if there is any other way.
I need to convert the '04/01/2009' date in string format to '4/1/2009'.
Basically, i need to trim out the leading zeros using Trim functions.
Code: Select all
My code:
Trim('04/01/2009'[1,2], '0','L') :'-' : Trim('04/01/2009'[4,2], '0','L') :'-': Right('04/01/2009',2)
Instead of using this lengthy code can we convert the source string to date and then back to string to get just as '4/1/09'. Or please let me know if there is any other way.