Subject | Joining table in UPDATE statement? |
---|---|
Author | Anthony Tanas |
Post date | 2006-11-20T17:48:21Z |
I'm trying to do this:
UPDATE
PATIENTRECALL
SET
PATIENTRECALL.RECALLSTATUS = 'rsMail'
FROM
PATIENTRECALL
INNER JOIN PATIENT ON (PATIENTRECALL.PATIENTID = PATIENT.PATIENTID)
WHERE
PATIENTRECALL.RECALLDATE >= :STARTDATE AND
PATIENTRECALL.RECALLDATE <= :ENDDATE AND
PATIENT.INACTIVEPATIENT = 'F' AND
PATIENTRECALL.RECALLSTATUS <> 'rsCancelled' AND
PATIENTRECALL.RECALLSTATUS <> 'rsRecalled'
But it doesn't work...I also tried:
UPDATE
PATIENTRECALL
INNER JOIN PATIENT ON (PATIENTRECALL.PATIENTID = PATIENT.PATIENTID)
SET
PATIENTRECALL.RECALLSTATUS = 'rsMail'
WHERE
PATIENTRECALL.RECALLDATE >= :STARTDATE AND
PATIENTRECALL.RECALLDATE <= :ENDDATE AND
PATIENT.INACTIVEPATIENT = 'F' AND
PATIENTRECALL.RECALLSTATUS <> 'rsCancelled' AND
PATIENTRECALL.RECALLSTATUS <> 'rsRecalled'
Can someone point me in the right direction? Thanks in advance.
UPDATE
PATIENTRECALL
SET
PATIENTRECALL.RECALLSTATUS = 'rsMail'
FROM
PATIENTRECALL
INNER JOIN PATIENT ON (PATIENTRECALL.PATIENTID = PATIENT.PATIENTID)
WHERE
PATIENTRECALL.RECALLDATE >= :STARTDATE AND
PATIENTRECALL.RECALLDATE <= :ENDDATE AND
PATIENT.INACTIVEPATIENT = 'F' AND
PATIENTRECALL.RECALLSTATUS <> 'rsCancelled' AND
PATIENTRECALL.RECALLSTATUS <> 'rsRecalled'
But it doesn't work...I also tried:
UPDATE
PATIENTRECALL
INNER JOIN PATIENT ON (PATIENTRECALL.PATIENTID = PATIENT.PATIENTID)
SET
PATIENTRECALL.RECALLSTATUS = 'rsMail'
WHERE
PATIENTRECALL.RECALLDATE >= :STARTDATE AND
PATIENTRECALL.RECALLDATE <= :ENDDATE AND
PATIENT.INACTIVEPATIENT = 'F' AND
PATIENTRECALL.RECALLSTATUS <> 'rsCancelled' AND
PATIENTRECALL.RECALLSTATUS <> 'rsRecalled'
Can someone point me in the right direction? Thanks in advance.