Generate a custom field on the basis of a inner query

Posts   
 
    
Posts: 87
Joined: 17-May-2011
# Posted on: 16-May-2012 11:40:31   

Hi there

I have query in which i need to generate custom fields on the basis of inner queries, Kindly tell me how should I implement in self servicing, below is my query

Select MatchMaker.MatchMakerID,
LeadCount=(Select COUNT(Distinct(clientId)) from clients where Status='n' and IsDeleted<>1 and MatchmakerCode=MatchMaker.MatchMakerID),
ClientLeadCount=(Select COUNT(Distinct(clientId)) from clients where Status='l' and IsDeleted<>1 and MatchmakerCode=MatchMaker.MatchMakerID),
Clients=(Select COUNT(Distinct(Clients.ClientID)) from Clients  
         inner join Client_MatchMaker on Clients.ClientID =Client_MatchMaker.ClientID and( 
         Clients.MatchmakerCode= MatchMaker.MatchMakerID or Client_MatchMaker.MatchMakerID= MatchMaker.MatchMakerID))
 from MatchMaker

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 17-May-2012 02:41:53   

I think you are looking for ScalarQueryExpressions

Posts: 87
Joined: 17-May-2011
# Posted on: 23-May-2012 15:38:09   

Thanks again buddy, You people rock simple_smile