on 11-21-2014 10:29 AM
Hi Experts,
Is it possible to find a list of items that have not been sold in the last 2 years?
Possible SAP Report or SQL Query?
Thank you.
Hi Paul ,
try this
SELECT ItemCode, ItemName FROM OITM
WHERE ItemCode NOT IN (SELECT ItemCode FROM OINM where DocDate >= DATEADD(year,-2,GETDATE()))
Regards,
BHARATHIRAJA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bharathiraja
Will not also pull out other documents not related to "sold" i.e credit notes etc....
"sold" as in Invoices comes from OINV - document level and INV1 - ItemLevel afaik.
regards
Malcolm
Hi
Adjust as you see fit.
Select Itemcode, max(Docdate) as LastInvoiceDate from INV1
group by itemcode
having max(Docdate)<=DATEADD(year,-2,GETDATE())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
try below.
SELECT itemcode
FROM [youritemtable]
WHERE itemcode NOT IN (
SELECT DISTINCT itemcode FROM [yoursalestable] where year([yourdatesoldfield]) >= (year(getdate()) -2)
)
note: this is not tested, please modify just in case there's wrong with the query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
7 | |
7 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.