Skip to content

Instantly share code, notes, and snippets.

@PirateGrunt
Created March 13, 2013 13:38
Show Gist options
  • Save PirateGrunt/5152111 to your computer and use it in GitHub Desktop.
Save PirateGrunt/5152111 to your computer and use it in GitHub Desktop.
Test calculation of start and end period udfs.
DECLARE @TestDate datetime
SET @TestDate = CAST('08-15-2000' AS datetime)
SELECT dbo.udfBeginningOfYear(@TestDate) AS BeginningOfYear
, dbo.udfEndOfYear(@TestDate) AS EndOfYear
, dbo.udfBeginningOfSemi(@TestDate) AS BeginningOfSemi
, dbo.udfEndOfSemi(@TestDate) AS EndOfSemi
, dbo.udfBeginningOfQuarter(@TestDate) AS BeginningOfQuarter
, dbo.udfEndOfQuarter(@TestDate) AS EndOfQuarter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment