11/25/2024 4:22:03 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss general T-SQL questions and help with queries related to SalesLogix data. View the code of conduct for posting guidelines.
|
|
|
|
UserNames instead of UserIDs
Posted: 27 Nov 08 10:36 AM
|
Hello everyone,
I have the following query running in a script, at the moment this returns the ID of the Account Managers, How can I return the UserNames instead of the IDs? Thank you for your help, S
strSQL = "SELECT A1.OPPORTUNITYID, A3.EMAIL, A4.ACCOUNT, A3.PREFIX, A3.FIRSTNAME, A3.LASTNAME, A1.ACCOUNTMANAGERID FROM OPPORTUNITY A1 LEFT OUTER JOIN ACCOUNT A4 ON (A1.ACCOUNTID=A4.ACCOUNTID) LEFT OUTER JOIN OPPORTUNITY_CONTACT A2 ON (A1.OPPORTUNITYID=A2.OPPORTUNITYID) LEFT OUTER JOIN CONTACT A3 ON (A2.CONTACTID=A3.CONTACTID) WHERE (A1.OPPORTUNITYID = '" & strCrntOppID & "')"
|
|
|
|
Re: UserNames instead of UserIDs
Posted: 27 Nov 08 5:35 PM
|
You'll need to add a join from OPPORTUNITY to USERINFO on ACCOUNTMANAGERID = USERID to get the USERNAME field. |
|
|
| |
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|