M
Magius96
I need to delete records from my table when a field in another table does not
contain a certain value. I have the following SQL that selects the correct
accounts, but when I try to run it, it says it can't delete records from the
table. I can't figure out why!
DELETE PLD.* FROM AIS RIGHT JOIN PLD ON AIS.DEBTOR_FILENO =
PLD.DEBTOR_FILENO WHERE (((IIf([AIS].[ED_CUR_COND]<>'REHAB' Or
[AIS].[ED_FALLOUT_DT] Is Not Null Or
[AIS].[ED_FALLOUT_DT]>[PLD].[ED_COND_OPEN_DT] Or [AIS].[ED_FALLOUT_RSN] Is
Not Null,1,0))=1))
Can anyone give me some directive to get this working?
In english, Records should be deleted from the PLD table if in the AIS
table the condition is not 'REHAB', or there is a Fallout date that is after
the setup date, or there is a fallout reason.
The three fields being referenced in the AIS table do not exist in the PLD
table. The two tables are linked using file numbers. We can't create
relations in the database, and have to setup the relations on a query by
query basis because some queries require the relations to be set differently.
contain a certain value. I have the following SQL that selects the correct
accounts, but when I try to run it, it says it can't delete records from the
table. I can't figure out why!
DELETE PLD.* FROM AIS RIGHT JOIN PLD ON AIS.DEBTOR_FILENO =
PLD.DEBTOR_FILENO WHERE (((IIf([AIS].[ED_CUR_COND]<>'REHAB' Or
[AIS].[ED_FALLOUT_DT] Is Not Null Or
[AIS].[ED_FALLOUT_DT]>[PLD].[ED_COND_OPEN_DT] Or [AIS].[ED_FALLOUT_RSN] Is
Not Null,1,0))=1))
Can anyone give me some directive to get this working?
In english, Records should be deleted from the PLD table if in the AIS
table the condition is not 'REHAB', or there is a Fallout date that is after
the setup date, or there is a fallout reason.
The three fields being referenced in the AIS table do not exist in the PLD
table. The two tables are linked using file numbers. We can't create
relations in the database, and have to setup the relations on a query by
query basis because some queries require the relations to be set differently.