Thread: Problem with Delete query.
05-14-04, 01:12 #1Registered User
- Join Date
- Apr 2004
Unanswered: Problem with Delete query.
What I have is two tables. One with all the customer details(eg. account number, name, address, etc.. called QFL and another with Notes for them call QFL NOTES with stuff like notes in them. These two tables have a relationship joined by the ac number field.
Now I want to issue a statement to delete all records from QFL NOTES from the account
which has has ODUE3_BAL and ODUE3_BAL that is greater than 0 in the QFL table, their QFL NOTES date has to be 7 days old and LETTER2 is yes.
This is what I tried but it dont seem to work.
DELETE [QFL NOTES].*
FROM [QFL NOTES] RIGHT JOIN QFL ON [QFL NOTES].AC_NUMBER=QFL.NUMBER
WHERE ((([QFL NOTES].DATE)<DateAdd("d",-7,Date())) AND (([QFL NOTES].LETTER2)=Yes) AND ((QFL.ODUE3_BAL)<="0") AND ((QFL.ODUE4_BAL)<="0"));
Can anyone help as I am fairly new to SQL.
05-14-04, 01:51 #2Registered User
- Join Date
- Mar 2004
- Adelaide, Australia
DELETE *.[QFL NOTES] FROM ........
Generally it works like this; [columnname].[tablename], so *.[QFL NOTES] would reference all columns in the QFL NOTES table.
Programmer response #5 - "Even though it doesn't work, how does it feel?"