Solved

How to change format of date displayed on report header

  • 30 August 2022
  • 5 replies
  • 597 views

I am very new to Acumatica, I have inherited a lot of reports in which I want to update the formatting. One thing I’m stuck on is how the coding works on formatting the date. I changed the formula to this (see below). It currently reads as: 

I want to change the format to include a “/” or a “-” inbetween the month and Year. Another thing I want to do is to just have the last 2 digits of the year if possible so it can look like this “08-22” or at least be able to read as “08-2022”. Any help is greatly appreciated.

 

 

icon

Best answer by taranjitgill 1 September 2022, 19:59

View original

5 replies

Userlevel 7
Badge +4

Hi @taranjitgill! You can make the “Period:” it’s own text box and so that the expression is just the formula.

For the formula there are probably several ways to accomplish this but the first thing that comes to mind is to do something like =Iif(Month(Now())<10, '0'+Month(Now()), Month(Now()))+'-'+Right(Year(Now()), 2).

The result looks like this:

 

Thank for your reply @BenjaminCrisman, it seems like you are coding it to pull in the exact date of “08-22”, sorry I did not clarify I am running a report that uses a Start and End Period for the date parameters, and I want the “Period: ___” to include the 2 periods used within the parameters used to run the report data. Is it possible to have a dash in between the month and years on the Format used in my formula? 

For example if I ran a YTD report, I’d want it to say “01-2022 to 08-2022” utilizing both “@StartPeriod” and “@EndPeriod”.

@BenjaminCrisman 

I was able to write this out to get what I wanted:

='Period: ' +  Report.FormatPeriod(@StartPeriod) + ' to ' + Report.FormatPeriod(@EndPeriod)

 

 

I wanted the dates to be in this format, and was able to figure out that removing the “Format(‘{0: MM/yyyy})” was causing the bunching of the month and year together. Hope this helps and this is what I was aiming for. I added in the “Report.FormatPeriod” which I honestly do not know what it does LOL, but I was it on another report I inherited and plugged it in and saw that it was able to get the format to show the date as “MM-YYYY”.
 

 

Userlevel 7
Badge +4

@taranjitgill nice work! Yeah I missed the mark a little bit with the first suggestion and I hadn’t had time to follow up yet, but glad to see it was worked out.

I hadn’t seen the Report.FormatPeriod used like this, typically I see it in a parameter or something, but great work!

Userlevel 7
Badge

Thank you for sharing your solution with the community @taranjitgill !

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved