Home Forums SQL Server 2008 T-SQL (SS2K8) User Defined Function that returns Start Date and End Date RE: User Defined Function that returns Start Date and End Date

  • If the parameters are integers

    DECLARE @Month int = 2

    DECLARE @Year int = 2014

    SELECT

    DATEADD(month,(@Year*12-22800)+(@Month-1),0) AS [SatrtDate],

    DATEADD(daY,-1,DATEADD(month,(@Year*12-22800)+@Month,0)) AS [EndDate]

    Far away is close at hand in the images of elsewhere.
    Anon.