Date formatting in APR emails

We send out POs using break/routing in the report style.

We would like to use the PO data as part of the file name of the invoice – PO#-yymmdd or something similar.

However the default date format appears to be the full date: Tuesday, March 19, 2021, which is too cumbersome.

Is there any way to change the format of this field?

Thanks.

—sam

1 Like

@skhayatt There are separate Month Day and Year but I don’t remember liking their format either. I would just set the value I wanted for the pdf name in a UD in POHeader and then grab that when printing.

1 Like

Thanks. Will give it a shot.

If you can figure out how to do that from in the RDD I bet you could get it to work. I haven’t tried formatting in the RDD.

Did not think of that. The other thing was considering was creating a directive-level variable, but have never done that before.

As it turns out, the user is OK with that format being used as part of the file name, so I will play around for my own education when I have a moment.

1 Like

Has anyone figured out a solution to this APR Email date formatting issue? It is incredibly unhelpfulf to have all dates show up in the long format.

I would also like to format a decimal amount to only include 2 decimal digits. I’ve tried playing around with the {date} format in the Report Data Definition without any luck, but I’m not really sure I’m even doing it right.

I don’t think you can do that easily. If you really, really need it, one thing you can try is add a string UD field (for POHeader or whatever) and then a BPM that populates it with the format you want (maybe PO.Update.Pre). Then, bring that in the RDD and use it in APR.

1 Like

Thank you, I will give that a try.

To close the loop on this… my reports are BAQ reports, so I could add a calculated field easily.

New report and I now need to display the field EffDate in the email subject line, in the email body AND as part of the attachment filename. Need two calculated fields because the filename cannot have “/”.

Calculated field (name: DisplayEffDate) for the email subject and body (results in 08/31/2024):

convert(varchar, EffDate, 101)

Calculated field (name: FileNameDate) for the filename (results in 20240831):

convert(varchar, datepart(year, EffDate))
+ 
(case when datepart(month, EffDate) <10 then '0' + convert(varchar, datepart(month, EffDate)) else convert(varchar, datepart(month, EffDate)) end)
+
(case when datepart(day, EffDate) <10 then '0' + convert(varchar, datepart(day, EffDate)) else convert(varchar, datepart(day, EffDate)) end)

If you are not working with a BAQ, you might be able add a UD field as suggested above.

3 Likes