Expand my Community achievements bar.

Last_Day SQL function does it exist in ACS?

Avatar

Level 1

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

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Community Advisor

@elisa55 Can you try along these lines,

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

Thanks, Sathees

Avatar

Community Advisor

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

Avatar

Level 1

I have same problem

Avatar

Community Advisor

HI @YueshengZh @elisa55,

 

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

 

 

Regards,

Celia