Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advanced Distinct in sql select 1

Status
Not open for further replies.

Stripes1283

Programmer
Jun 13, 2007
28
ZA
Hi I am selecting members from a table every member has 2 beneficiaries, when the data displays says for one member, then it display the member details at each beneficiary detail.
is there anyway i can show the member details only at the top beneficiary causing it to be categorised under the member detail, instead of showing the member details twice, now i cant use distinct only cause the beneficiary detail isnt the same, so where it is say...

Member beneficiary
Shaun Mike
Shaun William

I would like it to be:

Member Beneficiary
Shaun Mike
William

Thanks for any help kind Regards.
 
No, this is a job for your front end reporting tool. SQL Server works in resultsets where each record has the same columns.
 
Thanks im using report server i have tried to do this with a subreport on the beneficiaries part but i cant distinguis between the data is just gives me the distinct member and then all the beneficiaries un that member and then it just loops like that. Any ideas?
 
By "report server," do you mean SQL Server Reporting Services? If so, the easiest solution would be to alter the expression in the "Member" textbox to the following:
Code:
=iif(Previous(Fields!Member.Value) = Fields!Member.Value, "", Fields!Member.Value)

No subreport needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top