Query to find Last day of the current month

Posted by Kirthiga under Sql Server on 5/23/2018 | Points: 10 | Views : 333 | Status : [Member] | Replies : 9
How to find last day of the current month in sql server




Responses

Posted by: Rajnilari2015 on: 5/23/2018 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
Try this

select 
EOMONTH(getdate()), -- sql server 2012 onwards
DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, getdate()) + 1, 0)) -- any version of sql


Hope this helps

--
Thanks & Regards,
RNA Team

Kirthiga, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saraabo1 on: 6/7/2018 [Member] Starter | Points: 25

Up
0
Down
https://www.quickensupportnumber.com Quicken Support Number


Kirthiga, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saraabo1 on: 6/7/2018 [Member] Starter | Points: 25

Up
0
Down
http://www.hpsupportnumber.com/

Kirthiga, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saraabo1 on: 6/7/2018 [Member] Starter | Points: 25

Up
0
Down
http://www.microsoftcustomersupports.com

Kirthiga, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saraabo1 on: 6/7/2018 [Member] Starter | Points: 25

Up
0
Down
http://www.printertechservice.com

Kirthiga, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saraabo1 on: 6/7/2018 [Member] Starter | Points: 25

Up
0
Down
http://www.antivirustechhelp.com/mcafee-antivirus.html

Kirthiga, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saraabo1 on: 6/7/2018 [Member] Starter | Points: 25

Up
0
Down
http://www.mcafeehelpnumber.com

Kirthiga, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saraabo1 on: 6/7/2018 [Member] Starter | Points: 25

Up
0
Down
http://www.mcafeehelpnumber.com

Kirthiga, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saraabo1 on: 6/7/2018 [Member] Starter | Points: 25

Up
0
Down
http://www.antivirustechhelp.com/mcafee-antivirus.html

Kirthiga, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response