Thread: Help with SQL

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    3
    Rep Power
    0

    Help with SQL


    I am hoping someone could help me, I have the following code

    -- DELETE Current month and Month - 1 records from MonthlyTbl
    DELETE FROM dbo.tbl_STG_MONTHLY_TR
    WHERE [Month Number] > MONTH(GETDATE()) - 2
    AND [Year] = YEAR(GETDATE())

    But it is not deleting the records, can you tell me why?
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,118
    Rep Power
    4274
    Originally Posted by bryanscott53
    But it is not deleting the records
    oh yes it is

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo