Displaying only one records from list of results in a dataset
Hi I've written below query... SELECT DateStart, DateEnd, State, Group, Territory, Customer, Channel,Cluster,Banner,Grade,CallType, SUM(CASE WHEN DateStart IS NOT NULL THEN 1 ELSE 0 END) AS Called, SUM(CASE WHEN DateStart IS NULL THEN 1 ELSE 0 END) AS Not Called FROM Customer LeftJoin Card ON Customer.ID = Card.CustomerID ----- ---- WHERE DateStart = @Start and DateEnd = @End Group BY DateStart,DateEnd,State,Group,Territory,Customer,Channel,Cluster,Banner,Grade,CallType ORDER BY DateStart,DateEnd,State,Group,Territory,Customer,Channel,Cluster,Banner,Grade,CallType In Result Set, am getting result as below... DateStart DateEnd State Group Territory Customer Channel Cluste Banner Grade CallType 29/7/2012 30/7/2012 AAA A AZX XXX 122 544 121 4232 533 30/7/2012 31/7/2012 AAA A AZX XXX 122 544 121 4232 533 I am using this as a dataset in SSRS report and using drill down approach to see the result. The issue is I want to see customer once. As in the above result we are getting the same customer twice. My aim for the report is to see whether the customer called or not. I do not want how many times customer called. How can I display the customer XXX only once. that means irrespective of how many times i get the customer but i have display only once. Please suggest. Thanks in advance.
August 6th, 2012 2:34am

Hi, Just drag a customer to row group and for fields which are same for customer use MIN or MAX.. Also if possible delete this duplicate thread http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/51923d51-3197-4e71-8ae3-290c5fe2c131- Chintak (My Blog)
Free Windows Admin Tool Kit Click here and download it now
August 6th, 2012 2:36am

Can you consider DateStart min,DateEnd max based on customer id wise.
August 6th, 2012 3:13am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics