Can anyone point out the problem with the below query, I keep getting the following error: "Msg 4104, Level 16, State 1, Line 1 The multi-part identifier could not be bound."
select top 1 *
from [ADatabase].[dbo].[Tracking]
where [ADatabase].[dbo].[Drivers].[DriverId] = [ADatabase].[dbo].[Tracking].[DriverOneId]
and [UTCEventTime] > '2019-02-27'
order by [Id] desc
I have looked at several examples of this issue but they all seem to be linked to more complex multi table join queries.
Thanks
[ADatabase].[dbo].[Drivers].[DriverId] = [ADatabase].[dbo].[Tracking].[DriverOneId]predicate? - Damien_The_UnbelieverFROMclause. Why isDriversthere? What are you trying to do? Return all matching rows from both tables? Or onlyTrackingfields that have a matching driver? - Panagiotis Kanavos