Last Day of Month
Last Day of Month
I have a variable called AsOfDate that contains a date (such as 10/15/2014). How do I find the last day of the month of that date, so I can display 10/31/2014 in the report, even though the date in the variable is 10/15/2014?
Re: Last Day of Month
Hello,
Please try to use the following expression:
Thank you.
Please try to use the following expression:
Code: Select all
{new DateTime(AsOfDate.Year, AsOfDate.Month, DateTime.DaysInMonth(AsOfDate.Year, AsOfDate.Month))}
Re: Last Day of Month
That worked perfectly. Thank you.
Re: Last Day of Month
Hello, Tim.
It is a pleasure to help you.
Thank you.
It is a pleasure to help you.
Thank you.
Re: Last Day of Month
Hi,
I have a field called (report___remittance_report.Date___Due_Date) that contains certain dates in a month.
How can I get the First and Last Dates of the month?
I have a field called (report___remittance_report.Date___Due_Date) that contains certain dates in a month.
How can I get the First and Last Dates of the month?
Last edited by KP493 on Fri Nov 12, 2021 2:24 pm, edited 2 times in total.
-
- Posts: 6269
- Joined: Tue Mar 20, 2018 5:34 am
Re: Last Day of Month
Hello,
You can use following expressions:
first - {new DateTime(report___remittance_report.Date___Due_Date.Year, report___remittance_report.Date___Due_Date.Month, 1)}
last - {new DateTime(report___remittance_report.Date___Due_Date.Year, report___remittance_report.Date___Due_Date.Month, DateTime.DaysInMonth(report___remittance_report.Date___Due_Date.Year, report___remittance_report.Date___Due_Date.Month))}
You can use following expressions:
first - {new DateTime(report___remittance_report.Date___Due_Date.Year, report___remittance_report.Date___Due_Date.Month, 1)}
last - {new DateTime(report___remittance_report.Date___Due_Date.Year, report___remittance_report.Date___Due_Date.Month, DateTime.DaysInMonth(report___remittance_report.Date___Due_Date.Year, report___remittance_report.Date___Due_Date.Month))}