Skip to main content

B1 Print and Delivery - Report Action - How to add report generation date (today's date) to the attachment template

Completed

Comments

7 comments

  • Rasmus Jensen

    This is already possible by using the SQL: syntax 

    So if you write

    SQL:SELECT CONCAT('USSODetails_',FORMAT(getdate(),'yyyyMMdd'))

    you will get the required result

  • Rasmus Jensen

    Note: My specific SQL statement here requires that you run the SQL server 2012 or higher. It is possible to get it working on lower SQL server versions but the SQL needs to be written in a more clunky way with Casts and convert (you will need to find such a solution on your own if needed as SQL servers lower than 2012 is out of support)

  • Amber Wan

    It works perfectly. Thank you!!

  • Jason Killelea

    Is this possible in the HANA version? I can't get it to work with either MS or HANA SQL syntax.

  • Rasmus Jensen

    If it is possible in HANA SQL then it is possible to use... A quick google search gave this: https://stackoverflow.com/questions/46981250/how-to-format-date-in-hana

    So try the SQL in HANA studio, and when it gives the desired string there, it should work in the product

  • Jason Killelea

    Hi Rasmus,

    I never got this working (despite the SQL working perfectly in HANA studio.) Boyum gives an error about special characters not allowed and cannot save. I just had a colleague reach out to me about the same issue so I finally got around to posting again.

    I think the problem is that the SQL interpreter in the Report Action window is validating against MS SQL syntax, but that won't work for HANA. I think this is a bug.

  • Rasmus Jensen

    Hi Jason

    Please log a support ticket with the details on what you do + the error message and we will take a look... But I can't see why it should not work as it is jst SQL and we have no limits on what can be done

Please sign in to leave a comment.