Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pkpandey
Contributor III
Contributor III

Last Date Of the Month

Hi All

How to get the last date of the month in the expression Max({<Year={$(=Max(Year))},Month={$(=Month(Max(TranDate)))}>} TranDate)

where TranDate is in DD/MM/YYYY format and I need the last date of the month also in the same format.

Labels (1)
13 Replies
Gysbert_Wassenaar

Yeah, but the time fraction of a date returned by monthstart is 0. The time fraction of a date returned by monthend however is 1 millisecond less than a full day. It makes a difference when you want to compare or select the last date in a month with the result from a calculation that should return the last date of a month. MonthEnd won't unless you use the floor function on its result. MonthStart(Date, 1)-1 will give you the last day of the month too.


talk is cheap, supply exceeds demand
sunny_talwar

Got it

Thanks for the explanation

pkpandey
Contributor III
Contributor III
Author

Its always giving date in no. like 42429 for 29/02/2016.

Best Regards

PKP

jagan
Luminary Alumni
Luminary Alumni

Use Date() on top this, it will convert to Date format.

Regards,

Jagan.