cfcProgrammer
Programmer
Hi,
I have a query that I am getting multiple records in my result however, I am only expecting one per id.. I'm unsure why this is happening as there is only one record in each table per id, I just wanted to join the tables so I could access different data from each table. Could someone please help?
Thanks so much
SELECT cn.id as 'ID',
cn.accountnr as 'Account Number',
cn.accountName as 'Account Name',
cn.totalCredit as 'Credit Amount',
cn.created_on as 'Date Created',
cn.area as 'Area',
cn.derivedClass as 'Class',
cn.status as 'Status',
cn.researcher as 'Creator',
c.logdate AS Date,
c.logstatusfrom AS Log_Status_From,
c.logstatusto AS Log_Status_TO,
c.loguserid AS User_Id,
w.forename + ' ' + w.surname AS 'User Name',
c.logcomment AS Comments
FROM
w_user w, Note cn
inner join NoteChangeLog c
ON
cn.id = C.logNoteId
WHERE (status LIKE('%Rejected%') and status <> 'Rejected Billing Research')
OR (logStatusTo LIKE '%Rejected%' and logStatusTo NOT LIKE '%Rejected Billing Research%')
AND c.loguserid = w.id
ORDER BY cn.id, Class
Thanks so much!
cfcprogrammer
cfcProgrammer
I have a query that I am getting multiple records in my result however, I am only expecting one per id.. I'm unsure why this is happening as there is only one record in each table per id, I just wanted to join the tables so I could access different data from each table. Could someone please help?
Thanks so much
SELECT cn.id as 'ID',
cn.accountnr as 'Account Number',
cn.accountName as 'Account Name',
cn.totalCredit as 'Credit Amount',
cn.created_on as 'Date Created',
cn.area as 'Area',
cn.derivedClass as 'Class',
cn.status as 'Status',
cn.researcher as 'Creator',
c.logdate AS Date,
c.logstatusfrom AS Log_Status_From,
c.logstatusto AS Log_Status_TO,
c.loguserid AS User_Id,
w.forename + ' ' + w.surname AS 'User Name',
c.logcomment AS Comments
FROM
w_user w, Note cn
inner join NoteChangeLog c
ON
cn.id = C.logNoteId
WHERE (status LIKE('%Rejected%') and status <> 'Rejected Billing Research')
OR (logStatusTo LIKE '%Rejected%' and logStatusTo NOT LIKE '%Rejected Billing Research%')
AND c.loguserid = w.id
ORDER BY cn.id, Class
Thanks so much!
cfcprogrammer
cfcProgrammer