You need to sign in to do that
Don't have an account?

Sforce Connector - how to query related tables?
I have accounts with specific qualities and these accounts have contacts. I want to run a query on contacts where the accounts have a certain quality. How can I set conditions that relate to a related table? I hope someone can help me :)
Select c.id, c.name, c.email from Contact c where account.name = 'TESTACCOUNTNAME'
I must be doing something wrong...help very much appreciated since this will help me maintain our database so much more efficient. Happy to send you this excel spreadsheet if that helps.
Steven
Well, here's how I handle this and admittedly it's kind of a pain, but does work. I, like you, generally have my options set to display the name instead of the ID. But, to do the join, and also sometimes even for updating data if the name is more than 15 characters, you need to use the ID. So, simply change the options to use the ID (Options | Related Names tab). Then refresh the query so the the IDs are displayed. If you want to see the names, once the joins / queries are complete, change the options and do a refresh again. Or, sometimes I copy the column of names and put it to the right of the table, but you need to leave a blank column when doing this so that the names are maintained, instead of the IDs when you do the refresh.
Let me know if this isn't clear. Kinda hard to write up how to do it -- easier to do it :smileyhappy:
Rhonda