Created
August 23, 2010 23:46
-
-
Save bkono/546581 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--'First Day of Last Month, and Last Day of Last Month' | |
declare @MyDate smalldatetime | |
set @MyDate = DATEADD(Month, -1, GETDATE()) | |
SELECT CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(@mydate)-1),@mydate),101) | |
set @MyDate = GETDATE() | |
SELECT CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(@mydate)),@mydate),101) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment