I have a 'person' table that has the following fields among others:
PersonID(primary key)
FirstName,
LastName,
DateOfBirth,
LicenseNumber
ClientD
LastVisitedDate
I have a second table 'Visitor History:
HistoryID (primary key)
FirstName
LastName
LicenseNumber
DateOfBirth
ClientID
DateCheckedIn
The same person will appear multiple times in the history table. I need to update the LastVisitedDate in the person table with th max DateCheckedIn date from the history table. I need to join by firstname, lastname.licensenumber, clientD (migration so the personID won't work) and update the LastVisitedDate in the person table with the MAX date from tjhe history table for that person. I 've tried various subquerys/joins without success. Thanks!
Start Free Trial