D7 join on cck fields in views I have 2 content types which are imported via feeds; One is "user" with a cck field referencing its primary key: user.id

The second is "time_entry", which has a cck field for the fk reference to user id: time_entry.user_id

Now that they are coming into drupal, i am trying to create a view which would have:
time_entry.id, time_entry.user_id, and user.fname, user.lname, which are in the user nodes.

I tried a few different things; I am not too familiar with d7 so entities, bundles, the relations module, etc. are confusing me. I got tangled up trying to even create a php field in views which would get the nid of the user referenced in the time entry table and load that user.node. Any help would be greatly appreciated.
Some questions first. What's the data model?


"Time Entry" -> "User Node" or
"Time Entry" -> "User Node" -> "User Entity"


Are you using "User Reference" and "Node Reference" fields for the reference fields? If so, no need to use PHP to do it. You can use the Views UI for this functionality.

First, make sure the View's Row Style is "Fields" the format is Table and the view type is Node. Filter by "Time Entry" type.

Then, on the Advanced Tab, add a "New Relationship" and choose the reference field you use to reference the "User Node". By doing this, it'll enable you to access the "User Node", aside from the original "Time Entry" data.

If you have 3 entities related, you have to add another relation to access the 3rd entity's data. Follow the same procedure as above (adding a new relationship) and use the "User Node" reference field to access the "User Entity" data.

Then you can just add the fields you want, namely user name, last name and so on.

Hope this helps.