Last_Day SQL function does it exist in ACS? | Community
Skip to main content
New Member
March 6, 2025
Solved

Last_Day SQL function does it exist in ACS?

  • March 6, 2025
  • 3 replies
  • 955 views

I need to add a formula in a workflow which should be based on the last date of the month for a given date.

This was originally done in SQL by using the function:

DATEFIELD > Last_Day(Add_Months(Current_Date+1,+4))

Now I am trying to replicate this result in ACS.

I am to this point:

@DateField > ToDate(DateOnly(AddDays(GetDate(), 120))) is there a way to make sure this calculation is based on Last_Day?

 

Thanks,

Elisa

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SatheeskannaK

@elisa55 Can you try along these lines,

SubMinutes(AddMonths(YearAndMonth(GetDate()), 1), 1)

3 replies

SatheeskannaK
Community Advisor
SatheeskannaKCommunity AdvisorAccepted solution
Community Advisor
March 7, 2025

@elisa55 Can you try along these lines,

SubMinutes(AddMonths(YearAndMonth(GetDate()), 1), 1)

Thanks, Sathees
ccg1706
Community Advisor
Community Advisor
March 14, 2025

Hi @elisa55,

 

You can try with these: 

ToDate(FormatDate(AddDays(GetDate(), 120), '%Y-%m-01'(DayCount(ToDate(FormatDate(AddDays(GetDate(), 120), '%Y-%m-01')) + 30) - DayOfMonth(ToDate(FormatDate(AddDays(GetDate(), 120), '%Y-%m-01'))))

The y and the m under format date will extract the year and the month.

 

If you need more help, please just let me know.

 

Regards, 

Celia

March 14, 2025

I have same problem

ccg1706
Community Advisor
Community Advisor
March 17, 2025

HI @yueshengzh @elisa55,

 

Have you tried what @satheeskannak and I were proposing? Please do let us know, we are here to help.

 

 

Regards,

Celia