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.