Link to home
Start Free TrialLog in
Avatar of Gus Koutsivitis
Gus KoutsivitisFlag for United States of America

asked on

Keep getting "The multi-part identifier 'xref.DisplaySetupID' could not be bound." SQL Server

Hi all.

I am trying to get this SQL query to run but keep getting the error, "The multi-part identifier 'xref.DisplaySetupID' could not be bound."  
I am not that good with SQL.  Any help would be appreciated.

select
edb.clientvisitguid, 
cv.ChartGUID, 
cv.ClientGUID, 
edb.Active, 
cv.idcode, 
cv.visitidcode, 
cv.ClientDisplayName, 
cv.currentlocation, 
cv.CurrentLocationGUID, 
cv.temporarylocation,
cv.TempLocnGUID, 
edLunit.Name, 
edLbed.Name, 
edb.EDLocationGUID, 
edb.edarrivaldtm, 
case when edb.active = 0 then 
edb.DischargeDtm else null 
end, 
cv.ArcType,
ds.DisplaySetupName, 
ds.DisplaySetupID

from 
SXAEDViewLocationXREF xref,
SXAEDBoard edb

join SXAEDDisplaySetup ds on 1=1
and ds.DisplaySetupID = xref.DisplaySetupID

join CV3ActiveVisit av on 1=1
and edb.ClientVisitGUID = av.VisitGUID

join CV3ClientVisit cv on 1=1
and av.VisitGUID = cv.guid
and av.ClientGUID = cv.ClientGUID

join cv3location edLunit on 1=1
and edb.EdUnitGuid = edLunit.guid
and edlUnit.name = 'EMER Emergency Department'

join cv3location edLbed on 1=1
and edb.EDLocationGUID = edLbed.GUID

join SXAEDLocation edlp on 1=1
and edlp.LocationGUID = ds.LocationGUID
and edlp.EDDisplayName = 'emergency department'
and ds.DisplaySetupName like '1_%provider%'


Open in new window

Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

what is your line 26? if it is another table, you should use a JOIN like you did from line 28 to 48.
This error message means that table or view SXAEDViewLocationXREF  does not contain a column DisplaySetupID.
Check that table or view.
Avatar of Gus Koutsivitis

ASKER

The SXAEDViewLocationXREF table does contain a column DisplaySetupID .
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial