Hello,
I am trying to format a date field on the results grid on a GI to be MMDDYY with no dashes or slashes I.e.
06/01/2022 should be formatted 060122, is there a way to convert with formatting or function?
Any help would be greatly appreciate it.
![](https://uploads-us-west-2.insided.com/acumatica-en/attachment/389568a4-37e9-497e-8e78-d0b3db55b254.png)
Hello,
I am trying to format a date field on the results grid on a GI to be MMDDYY with no dashes or slashes I.e.
06/01/2022 should be formatted 060122, is there a way to convert with formatting or function?
Any help would be greatly appreciate it.
Hi
= Concat( CStr(Month([SOOrder.OrderDate])) , CStr(Day( [SOOrder.OrderDate])) ,CStr(Year([SOOrder.OrderDate])))
Naveen,
Thank you so much for your prompt reply! , just what I needed , it was almost there with the exeption that I needed something like this , for 06/15/2022 I needed to display 061522 so I modified the statement slightly , I am posting this so it might help someone else in the future.
New revised statement
=Concat(IIf(Month([APPayment.DocDate]) < 10, '0'+CStr(Month([APPayment.DocDate])), CStr(Month([APPayment.DocDate]))) + IIf(Day([APPayment.DocDate]) < 10, '0'+CStr(Day([APPayment.DocDate])), CStr(Day([APPayment.DocDate]))) + Substring(CStr(Year([APPayment.DocDate])),3,2) )
It returns values as below ……
Thanks for this. I have to create the same thing for us. Our difference is ours requires a / between the dates. So mine is:
Returns: 05/04/2023
=Concat(IIf(Month([APPayment.DocDate]) < 10, '0'+CStr(Month([APPayment.DocDate])), CStr(Month([APPayment.DocDate]))) + '/' + IIf(Day([APPayment.DocDate]) < 10, '0'+CStr(Day([APPayment.DocDate])), CStr(Day([APPayment.DocDate]))) + '/' + CStr(Year([APPayment.DocDate]) ))
Here is another option using PadLeft. It simplifies the formula slightly.
=Concat(PadLeft(CStr(MONTH([APPayment.DocDate])), 2, '0'), PadLeft(CStr(DAY([APPayment.DocDate])), 2, '0'), Substring(CStr(Year([APPayment.DocDate])),3,2))
Breaking this down into the different parts:
=Concat( -- Combines the various strings together
PadLeft(CStr(MONTH([APPayment.DocDate])), 2, '0'), -- MONTH: Extracts the month from DocDate, CSTR: Converts it to a string value, PADLEFT: Ensures it is 2 characters wide with ‘0’ placed at the left to accomplish this
PadLeft(CStr(DAY([APPayment.DocDate])), 2, '0'), -- DAY: Extracts the day from DocDate, CSTR: Converts it to a string value, PADLEFT: Ensures it is 2 characters wide with ‘0’ placed at the left to accomplish this
Substring(CStr(Year([APPayment.DocDate])),3,2) -- YEAR: Extracts the year from DocDate, CSTR: Converts it to a string value, SUBSTRING: Extracts the characters starting at position 3, 2 characters
)
For those looking to follow the ISO 8601 standard, here is a formula for that.
=Concat(PadLeft(CStr(YEAR([APPayment.DocDate])), 4, '0'), PadLeft(CStr(MONTH([APPayment.DocDate])), 2, '0'), PadLeft(CStr(DAY([APPayment.DocDate])), 2, '0'))
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.