The following script can be run to find any parts that have had no issues and no receipts since the date you specified in the highlighted area. The date format is year-month-day.
Declare @Warehouse VarChar(30),@ReceiptOlderThan DateTime,@IssueOlderThan DateTime,@IncludeInactive NVarChar(1),@SkipZeroParts NVarChar(1)Set @Warehouse = 'All'Set @IssueOlderThan = '2021-01-1'Set @ReceiptOlderThan = '2021-01-1'Set @IncludeInactive = 'N'Set @SkipZeroParts = 'N'select P.Part_Code, P.Description, B.Branch_Code, W.Warehouse_Code,Inv.On_Hand_New, inv.Value_On_Hand,ISNULL(Convert(varchar, LastIssue,101),'Never') as LastIssued,ISNULL(Convert(varchar, LastReceipt,101),'Never') as LastReceived,P.Inactivefrom IN_Inventory InvInner join IN_Part P on P.Part_Id = Inv.Part_IdInner join IN_Warehouse W on W.Warehouse_Id = Inv.Warehouse_IdInner join AR_Branch B on B.Branch_Id = W.Branch_IdLeft Outer Join(Select Part_Id, Warehouse_Id, MAX(Date) as LastIssuefrom IN_JournalWhere Inventory_Activity_Id in (6,7,8,10) and Multiplier = -1 and Warehouse_Id > 1Group by Part_Id, Warehouse_Id) Issues on Issues.Part_Id = Inv.Part_Id and Issues.Warehouse_Id = inv.Warehouse_IdLeft Outer Join(Select P.Part_Id, R.Warehouse_Id, MAX(R.received_date) as LastReceiptfrom IN_Receipt_Parts PInner join IN_Receipt R on R.Receipt_Id = P.Receipt_IdWhere r.Is_Return = 'N' and Warehouse_Id > 1group by P.Part_Id, R.Warehouse_Id) Receipts on Receipts.Part_Id = Inv.Part_Id and Receipts.Warehouse_Id = Inv.Warehouse_IdWhere inv.Part_Id > 1 and inv.Warehouse_Id > 1 and (Warehouse_Code = @Warehouse or @Warehouse = 'All') andISNULL (LastReceipt, @ReceiptOlderThan) <= @ReceiptOlderThan andISNULL (LastIssue, @IssueOlderThan) <= @IssueOlderThan and (Inv.Value_On_Hand <> 0 or Inv.On_Hand_New <> 0 or @SkipZeroParts = 'N') and (P.Inactive = 'N' or @IncludeInactive = 'Y')