Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
werhardt
Constraint Violating Yak Guru
270 Posts |
Posted - 2009-07-31 : 07:41:24
|
| Not sure if you can help me or not. I am trying to find the unique member ids. It works if I use this statment below..Select DistinctCount (Distinct MemberID), MemberID--ClientNamefrom VW_Member_Count_FamilyID_ClientRecordGroup by MemberID The only thin is my client want to have the memberID, and the Patient First and last name associated with it. So, if I put this in there, it brings up two patients under the same memberID because the firstname and last name are different. How can I just pull one MemberID and still have the PatientLast/PatientFirst in the grouping?Select DistinctCount (Distinct MemberID), MemberID, PATIENTLASTNAME,PATIENTFIRSTNAME from VW_Member_Count_FamilyID_ClientRecord Group by MemberID,PATIENTLASTNAME--PATIENTFIRSTNAME Order by MemberID |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2009-07-31 : 08:47:49
|
| This sounds like a job for Crystal Reports!http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-07-31 : 08:54:00
|
| Yes. If you use Reporting tool, make use of it's Suppress if duplicated featureMadhivananFailing to plan is Planning to fail |
 |
|
|
werhardt
Constraint Violating Yak Guru
270 Posts |
Posted - 2009-07-31 : 09:00:09
|
I am actually going to be using Microsoft Visual Studiosquote: Originally posted by madhivanan Yes. If you use Reporting tool, make use of it's Suppress if duplicated featureMadhivananFailing to plan is Planning to fail
|
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2009-07-31 : 13:07:24
|
| 1. What version of SQL are you using?2. When there are mutiple rows for teh same ID, which one do you want?3. http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
 |
|
|
|
|
|
|
|