Number of days left in a given month How do I find the number of days left in the current month? Example if current month is November and todays date is 16/11/2016 The Numb
Use EOMONTH
and DATEDIFF
functions
declare @date date
set @date='16 Nov 2016'
select datediff(day,@date,eomonth(@date)) as days_left
Use below solution For Below versions of sql server 2012
DECLARE @DATE DATE
SET @DATE='16 NOV 2016'
SELECT DATEDIFF(DAY,@DATE,DATEADD( MM,DATEDIFF(MM,0,@DATE)+1,0))-1 AS DAYS_LEFT