Forum Replies Created

Viewing 3 posts - 1 through 4 (of 4 total)

  • RE: Return items not modified in "X" days?

    drew.allen (4/19/2012)


    You're looking for the HAVING clause.

    SELECT SerialNum, MAX(UsedDate) AS LastUsedDate

    FROM YourTable

    GROUP BY SerialNum

    HAVING MAX(UsedDate) < DATEADD(YEAR, -1, GETDATE())

    Drew

    Yay!! Awesome, thank you very much. I didn't even know that...

  • RE: Return items not modified in "X" days?

    ColdCoffee (4/19/2012)


    Need more clarification 🙂

    SELECT DATEADD(MM,-12,GETDATE())

    give you 2011-04-19 11:12:01.653

    Now if you had a row with April 2011, should that be neglected or should that be included?

    OK, I should have used...

  • RE: Return items not modified in "X" days?

    Edited OP for clarity 🙂

Viewing 3 posts - 1 through 4 (of 4 total)