• rkl1v09 (8/22/2014)


    Hi Brandie,

    Due date is DATETIME and i am literally just looking for 2 months data.

    Kind Regards,

    R

    Then instead of

    WHERE DATEDIFF(MONTH,a.trans_date,a.due_date) >= 2

    Try

    WHERE a.due_date >= DATEADD(m,-2,CONVERT(DATE,GETDATE(),101))

    This gives you every date in the last two months. If you want every date before the last two months, just switch the greater than sign to a less than sign.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.