Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Have a table call Invoice and it has Itemcode and saledate Columns
i want to get itemcodes which are not in transaction since last two year

how to do this using sql statement
Thanks
Posted
Comments
King Fisher 31-Mar-15 9:29am    
what have you tried so far?

1 solution

Try:
SQL
SELECT ItemCode FROM Invoice
GROUP BY ItemCode
HAVING MAX(SaleDate) < DATEADD(year, -2, GETDATE())
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900