Blog

Findout First Day and Last Day With Time Of The Previous Month By Using SQL

By Akash Garg Blogs | SQL Apr 09, 2013
We can find out the first and last day with time of the previous month by simple step.

The SQL query is shown below

SELECT DATEADD(month, DATEDIFF(month, -1, getdate()) - 2, 0) as FirstDayWithTime,

    DATEADD(ss, -1, DATEADD(month, DATEDIFF(month, 0, getdate()), 0)) as LastDayWithTime

COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs