Galleon Forums Home | Profile | Search | Login | RSS
New Topic Reply   Previous Page  Page: 1   Next Page

Thread: Query Question
Created on: 02/18/09 07:05 PM Replies: 0
mikeweezer
Member
mikeweezer's Gravatar
Joined: 12/10/08
Posts: 16
Query Question
02/18/09 7:05 PM

Hi Everyone -

I'm working on an application to pull all applicable customers to a specific salesperson through a join in SQL:

<cfquery datasource="#ds#"

            name="dashcust">


Select DISTINCT c.Customer_Name,

            c.KP_Customer, a.*, o.KP_Opportunity, o.KF__Customer

FROM Customer c

INNER JOIN Opportunity o ON c.KP_Customer=o.KF__Customer

INNER JOIN Opp_AEs_Join a ON o.KP_Opportunity=a.KF__Opportunity

WHERE a.KF__Account_Exec= '#SESSION.identity.aenum#'

ORDER BY c.Customer_Name



</cfquery>


However, when I output the query I'm not getting distinct Customer_Name, I get Customer_Name listed for every Opportunity.

Help! I know this is more of a SQL question, but I have good luck on this forum. Thanks again.
Link | Top | Bottom

New Post
Please login to post a response.