Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 2024 
 
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!
 Data & Imports Forums - T-SQL & Queries
Forum to discuss general T-SQL questions and help with queries related to SalesLogix data. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to T-SQL & Queries | New ThreadView:  Search:  
 Author  Thread: UserNames instead of UserIDs
Samuel
Posts: 18
 
UserNames instead of UserIDs Your last visit to this thread was on 1/1/1970 12:00:00 AM
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 & "')"

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: UserNames instead of UserIDs Your last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
Samuel
Posts: 18
 
Re: UserNames instead of UserIDs Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Nov 08 3:36 AM
Yes, Thank you!
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/25/2024 5:13:09 PM