Delete Queries

G

Guest

I have a database which stores information across several linked tables about
people, attendance at different events and items they have borrowed. The
borrowed items table has the date borrowed and the date returned with both
set as date/time. I want to create a delete query which will delete all
records in which the returned date is more than 3 years ago.

e.g. Borrowed Date: 21/08/1995
Returned Date: 16/09/1999

I have been told to use the function:
(NOW())-(3*365) but it doesn't yield any results from my tables.

Please help...
 
K

Ken Snell [MVP]

Try this:

DELETE *
FROM BorrowedItemsTableName
WHERE DateAdd("yyyy", 3, [Returned Date]) < Date();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top