You can do something along these lines:dateadd(mm,datediff(mm,0,getdate())0,0) -- gives you beginning of this monthdateadd(mm,datediff(mm,0,getdate())+1,0) -- gives you beginning of next monthdateadd(mm,datediff(mm,0,getdate())+2,0) -- gives you beginning of the month after that
Then you can use datediff function like this:datediff( dd, getdate(), dateadd(mm,datediff(mm,0,getdate())+1,0) )
That gets you days till beginning of next month.