I’m having problems UPDATING a table.
I have this query:
SELECT DISTINCT LocationNumber,
tblLocation.Latitude, tblLocation.Longitude) as Miles
INNER JOIN tblTerminals ON tblTerminals.TerminalName = tblLocation.Terminal
WHERE tblTerminals.FacilityID IS NOT NULL AND LEN(LTRIM(tblTerminals.FacilityID)) > 0
AND tblLocation.Inactive = 'false'
Which returns the LocationNumber and Miles.
I need to:
SET tblLocation.MilesFromTerminal = Miles
WHERE tblLocation.LocationNumber = LocationNumber
But I cannot figure it out. Can someone please tell me how to UPDATE tblLocation?