- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Is there a way to find last date of month using any function? Like 03/15/2017 should return 03/31/2017? (SAP)
You can try using DateSerial() function.
DateSerial returns a Date value for the specified year, month and day. It also handles relative Date expressions.
Arguments
- year is a whole Number or numeric expression representing a year, example: 1996.
- month is a whole Number or numeric expression representing a month, example: 12 for December.
- day is a whole Number or numeric expression representing a day of the month, example: 5.
Returns
A Date value.
Action
DateSerial returns a Date value for the specified year, month and day. It also handles relative Date expressions.
DateSerial (2000, 6, 15)
DateSerial (2004, 1 - 7, 15)
DateSerial (2008, 1, 166)
Check the below code as it finds the first day of next month and then you can go back one day back to get last date of month.
DateSerial ( year({table.date}, month({table.date}) + 1, 1 - 1 ; )
You can refer this link to know more about this function −
Advertisements