Click here to Skip to main content
15,889,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys I need your help. For the most part, the Sql below works, but when I add (DRTM_AssetTracker_Person.Guid,DRTM_AssetTracker_Person.FirstName,DRTM_AssetTracker_Person.LastName) where (DRTM_AssetTracker_Asset.AssignedPersonID = DRTM_AssetTracker_Person.ID)

into the SQL, it gives this error


Msg 4104, Level 16, State 1, Line 5
The multi-part identifier "DRTM_AssetTracker_Person.ID" could not be bound.
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "DRTM_AssetTracker_Person.Guid" could not be bound.
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "DRTM_AssetTracker_Person.FirstName" could not be bound.
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "DRTM_AssetTracker_Person.LastName" could not be bound.

I can't seem to be able to fix the problem for a while now. Thanx for your help



SQL
SELECT DRTM_AssetTracker_Asset.ID, DRTM_AssetTracker_Asset.AssetIdentifier, DRTM_AssetTracker_Asset.CreatedOn, DRTM_AssetTracker_Asset.ModifiedOn, DRTM_AssetTracker_Asset.Notes, DRTM_AssetTracker_AssetCondition.Name AS 'Condition', DRTM_AssetTracker_AssetStatus.Name AS 'Status', DRTM_AssetTracker_School.SchoolLocationIdentifier, DRTM_AssetTracker_School.DisplayValue as 'Campus',DRTM_AssetTracker_Manufacturer.Name as 'Manufacturer', DRTM_AssetTracker_Person.Guid, DRTM_AssetTracker_Person.FirstName, DRTM_AssetTracker_Person.LastName

FROM DRTM_AssetTracker.dbo.DRTM_AssetTracker_Asset, DRTM_AssetTracker.dbo.DRTM_AssetTracker_AssetCondition, DRTM_AssetTracker.dbo.DRTM_AssetTracker_AssetStatus, DRTM_AssetTracker.dbo.DRTM_AssetTracker_Manufacturer, DRTM_AssetTracker.dbo.DRTM_AssetTracker_School

WHERE DRTM_AssetTracker_Asset.AssetConditionID = DRTM_AssetTracker_AssetCondition.ID AND DRTM_AssetTracker_Asset.AssetStatusID = DRTM_AssetTracker_AssetStatus.ID AND DRTM_AssetTracker_Asset.SchoolID = DRTM_AssetTracker_School.ID AND DRTM_AssetTracker_Asset.ManufacturerID = DRTM_AssetTracker_Manufacturer.ID AND DRTM_AssetTracker_Asset.AssignedPersonID = DRTM_AssetTracker_Person.ID
Posted

can you give me more information what you want, I think you have multiple table write after the From, Sql server can't allowed this type of function, you can solve problem with the help of Sql Join, for more information check out this linkWhat is a 'multi-part identifier' and why can't it be bound?
 
Share this answer
 
Comments
rudolph098 11-Dec-13 12:18pm    
thanks for the help, but I fixed it, I forgot to add (DRTM_AssetTracker_Person.Guid, DRTM_AssetTracker_Person.FirstName, DRTM_AssetTracker_Person.LastName) in the FROM clause.
I added (DRTM_AssetTracker_Person.Guid, DRTM_AssetTracker_Person.FirstName, DRTM_AssetTracker_Person.LastName) in the FROM clause.
 
Share this answer
 
Comments
joginder-banger 11-Dec-13 12:23pm    
means your problem have been solved?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900