1

PQL for dynamic text

Hi, I am struggling to write a PQL part for dynamic text to show the last day of the previous month based on current date.  is it possible and anyone able to assist? many thanks

1 reply

null
    • David_Barr
    • 4 yrs ago
    • Reported - view

    Hi Nicholas,

    The formula below will give you the value that you are looking for.

    DateFormat(AddDays(DateFormat(date(), "yyyy-MM-01"),-1),"YYYY-MM-dd")

    To break this down from inside out:

    • date()  : This returns the current date
    • DateFormat(<>, "yyyy-MM-01") : This uses the date formatting function to generate the first date of the month
    • AddDays(<>,-1) : This calculates the day prior to the first of the month
    • DateFormat(<>,"YYYY-MM-dd") : This sets the final result into the format that you would like to display

Content aside

  • Status Answered
  • 1 Likes
  • 4 yrs agoLast active
  • 1Replies
  • 56Views
  • 3 Following