Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jwilson911
Starting Member
2 Posts |
Posted - 2015-04-04 : 04:53:38
|
Hi.I have this error. I've looked at other solutions posted here and I can't find my answer.Ay help appreciated.Msg 4104, Level 16, State 1, Line 3The multi-part identifier "ephd.DepartmentID" could not be bound.USE AdventureWorks2012;GOSELECT TOP(10) eph1.BusinessEntityID, eph1.Rate, epdh.DepartmentID, RANK() OVER (PARTITION BY ephd.DepartmentID ORDER BY eph1.Rate DESC) AS RankBySalaryFROM HumanResources.EmployeePayHistory AS eph1INNER JOIN HumanResources.EmployeeDepartmentHistory AS epdh ON eph1.BusinessEntityID = epdh.BusinessEntityIDWHERE eph1.RateChangeDate = (SELECT MAX(RateChangeDate) FROM HumanResources.EmployeePayHistory AS eph2 WHERE eph1.BusinessEntityID = eph2.BusinessEntityID)ORDER BY RankBySalary,eph1.BusinessEntityID;goJohnRWilson |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2015-04-04 : 07:57:31
|
Epdh <>epdh |
|
|
jwilson911
Starting Member
2 Posts |
Posted - 2015-04-07 : 03:34:33
|
Can't believe this.Coming from a Sybase background this is something I would not have considered.Thanks gbritton for this.JohnRWilson |
|
|
Kristen
Test
22859 Posts |
Posted - 2015-04-07 : 08:05:39
|
I don't use SSMS but would it give you a wiggle-red underline for a "typo" like that? Or could it not resolve the name at Authoring-time anyway? |
|
|
|
|
|