I am working on SSRS Report, I have used 2 Date selection calendar, From Date and To date, So in From Date the Current months starting date should be as default date, and into the to date the Last date of the current month should be by default. Should I use Expression? or By SQL Query?
Using T-SQL for 2012 version or higher it's quite simple, using DateFromParts
to get the first day of the month and EOMonth
to get the last day:
DECLARE @Today Date = GETDATE();
DECLARE @FirstDayOfTheMonth date = DATEFROMPARTS(YEAR(@Today), MONTH(@Today), 1),
@LastDayOfTheMonth date = EOMONTH(@Today);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments