Question : Update Query: Replace values with a NULL when record is missing

I have two tables

1) SKPIUpdate
2) SKPIProblemLog

both table are identical in structure. The data is liquid and changes daily. I need a query that will compare the two tables and when SKPIProblemLog has a record that SKPIUpdate does NOT have.
I need the text located in the field named "FaultType" to be changed to "DELETED"

So, what ever text is in the field FaultType will be changed to "DELETED" when a record is is not found in SKPIUpdate.

Answer : Update Query: Replace values with a NULL when record is missing

Capricorn,
What does RECID stand for? I assume you mean to for me to use ScrapRecordTag ?

Yes


UPDATE SKPIProblemLog LEFT JOIN SKPIUpdate ON SKPIProblemLog.ScrapRecordTag = SKPIUpdate.ScrapRecordTag SET SKPIProblemLog.FaultType = "DELETED"
WHERE SKPIUpdate.ScrapRecordTag Is Null

Random Solutions  
 
programming4us programming4us