Looking for a Sql Statement to delete items never sold or received

Need help to delete some items from the database that are just using up space.

When we first got RMS someone had the bright idea just to load information from our suppliers.

The gave us so much stuff that some has never been used.

Just look for a quick way of deleteing this useless stuff from the database.

Items that have 0 quantity never sold or been received since created

Reply to
fabiano
Loading thread data ...

first off, always make sure you create a backup of your DB before running any queries, in case you need to restore back to that point

you can run this select query:

SELECT * FROM Item WHERE Quantity = 0 AND LastReceived IS NULL AND LastSold IS NULL

and review the data that is returned, checking to make sure there isn't anything there that you do not want to delete from the table. if you are ok with deleting these records then you can run this query:

DELETE FROM Item WHERE Quantity = 0 AND LastReceived IS NULL AND LastSold IS NULL

and like i said, make sure you back up first

hth kevin

"fabiano" wrote:

Reply to
kskinne

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.