I have searched but cannot find the SQL script to delete customers with no sales.
I thought I saw it on here at one time.
Can anyone help?
The problem for me is, I have customers with WORK ORDERS waiting to be filled that I do not want to delete. Their work orders have been tendered but have not been turned into an invoice yet.
(This is to delete customers that I imported from my other system a while ago that haven't been back)
Thanks for any help.
So far, the select query I have is:
SELECT [Order].ID AS orderID, [Transaction].TransactionNumber, Customer.AccountNumber FROM [Transaction] RIGHT OUTER JOIN Customer ON [Transaction].CustomerID = Customer.ID LEFT OUTER JOIN [Order] ON dbo.Customer.ID [Order].CustomerID WHERE ([Transaction].TransactionNumber IS NULL) AND ([Order].ID IS NULL)
mickie