Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
martilio
Starting Member
2 Posts |
Posted - 2009-09-11 : 12:08:06
|
| We will be removing from inventory items that were not used within past 2 years. I need to show these items on the report. How can I do that using SQL Query.Thanks in advance. |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-09-11 : 13:37:11
|
| with something like this:select sku, max(saleDate) as LastSaleDatefrom <sales Table>group by skuhaving max(saleDate) < dateadd(year, -2, getdate())Be One with the OptimizerTG |
 |
|
|
martilio
Starting Member
2 Posts |
Posted - 2009-09-11 : 14:11:06
|
| This is what I needed, THANK YOU TG!! |
 |
|
|
|
|
|