Mike Hughes
Registered User.
- Local time
- Today, 08:00
- Joined
- Mar 23, 2002
- Messages
- 493
I have a query.
It has two tables, one CINT3 AND one NOLDBA_COURT_CV_002_PARTIES the tables are joined by the field DOCKET_NO.
The problem I have is that when the query is run and there is more than one NAME_FIRST, NAME_LAST, ETC. I end up with several lines with the same DOCKET_NO if there are more than one NAME_FIRST, NAME_LAST, ETC.
I want one line with the DOCKET_NUMBER and all NAME_FIRST, NAME_LAST, ETC, not several.
I have created the code below and it gives me all the FIRST_NAME,LAST_NAME, ETC associated to the DOCKET_NUMBER on a single line but then that line repeats itself several time.
Can someone help me change the query to have one line for each DOCKET_NUMBER with all the NAME_FIRST, NAME_LAST,ETC without repeating the lines.
I'm sure this is confusing but it is the only way I can explain it
SELECT DISTINCT
a.[DATE RUN],
a.COURT,
a.RECEIVED,
a.SCHEDULED,
a.DOCKET,
a.TYPE,
a.ACTION,
b.NAME_FIRST AS [MEM B FIRST],
b.NAME_LAST AS [MEM B LAST],
b.DT_BIRTH AS [MEM B DOB],
b.SSN AS [MEM B SSN],
c.NAME_FIRST AS [MEM C FIRST],
c.NAME_LAST AS [MEM C LAST],
c.DT_BIRTH AS [MEM C DOB],
c.SSN AS [MEM C SSN]
FROM
CINT3 a,
NOLDBA_COURT_CV_002_PARTIES b,
NOLDBA_COURT_CV_002_PARTIES c
WHERE
b.SEQ_EVENT_GLOBAL_END=0 and
c.SEQ_EVENT_GLOBAL_END=0 and
b.DOCKET_NO = a.DOCKET and
c.DOCKET_NO = a.DOCKET
It has two tables, one CINT3 AND one NOLDBA_COURT_CV_002_PARTIES the tables are joined by the field DOCKET_NO.
The problem I have is that when the query is run and there is more than one NAME_FIRST, NAME_LAST, ETC. I end up with several lines with the same DOCKET_NO if there are more than one NAME_FIRST, NAME_LAST, ETC.
I want one line with the DOCKET_NUMBER and all NAME_FIRST, NAME_LAST, ETC, not several.
I have created the code below and it gives me all the FIRST_NAME,LAST_NAME, ETC associated to the DOCKET_NUMBER on a single line but then that line repeats itself several time.
Can someone help me change the query to have one line for each DOCKET_NUMBER with all the NAME_FIRST, NAME_LAST,ETC without repeating the lines.
I'm sure this is confusing but it is the only way I can explain it
SELECT DISTINCT
a.[DATE RUN],
a.COURT,
a.RECEIVED,
a.SCHEDULED,
a.DOCKET,
a.TYPE,
a.ACTION,
b.NAME_FIRST AS [MEM B FIRST],
b.NAME_LAST AS [MEM B LAST],
b.DT_BIRTH AS [MEM B DOB],
b.SSN AS [MEM B SSN],
c.NAME_FIRST AS [MEM C FIRST],
c.NAME_LAST AS [MEM C LAST],
c.DT_BIRTH AS [MEM C DOB],
c.SSN AS [MEM C SSN]
FROM
CINT3 a,
NOLDBA_COURT_CV_002_PARTIES b,
NOLDBA_COURT_CV_002_PARTIES c
WHERE
b.SEQ_EVENT_GLOBAL_END=0 and
c.SEQ_EVENT_GLOBAL_END=0 and
b.DOCKET_NO = a.DOCKET and
c.DOCKET_NO = a.DOCKET