Microsoft
Software
Hardware
Network
Question : Two Inner Joins in One Query
I have a query that needs to refer to two inner joins. I have it working with 1 inner join and but when I try to add the 2nd inner join it doesn't work...
My current query is as follows:
SELECT tblIncidentPeople.intIncid
entID, tblIncidentPeople.intPeopl
eID, tblIncidentPeople.txtInvol
vement, tblIncidents.intIncidentID
, tblIncidents.txtNatureOfIn
cident, tblIncidents.memIncidentSu
mmary, tblIncidents.datIncidentDa
te, tblIncidents.datIncidentTi
me, tblIncidents.datReportedDa
te, tblIncidents.datReportedTi
me, tblIncidents.datDateCreate
d, tblIncidents.booActive, tblIncidents.booReviewed, tblIncidents.booInvestigat
ion, tblIncidents.booClosed, tblIncidents.booHPD, tblIncidents.intPrimaryInv
estigator
FROM tblPeople INNER JOIN (tblIncidents INNER JOIN tblIncidentPeople ON tblIncidents.intIncidentID
= tblIncidentPeople.intIncid
entID) ON tblPeople.intPeopleID = tblIncidentPeople.intPeopl
eID
WHERE (((tblIncidentPeople.intPe
opleID)=[F
orms]![frm
Specificat
ionByPerso
nInvolved]
.[txtPerso
nInvolved]
));
BUT I need to add this inner join to the above query:
FROM tblIncidents INNER JOIN tblEmployee ON tblIncidents.intPrimaryInv
estigator = tblEmployee.intEmployeeID
Can someone provide SQL correct syntax please.
Answer : Two Inner Joins in One Query
Hi,
You can asign the Display and Value Members of the combo and the datagrid will do the match for you as long the field asigned to the comboboxcolum have values of the datasource asigned, like this:
Dim dgvc As DataGridViewComboBoxColumn
dgvc = CType( dgvRO.Columns("cboItemNo")
, DataGridViewComboBoxColumn
)
dgvc.DataSource = YOUDATASOURCE
dgvc.DisplayMember = "THE FIELD YOU WANT TO DISPLAY"
dgvc.ValueMember = "THE FIELD THAT MATCH IN BOTH TABLES"
This should be before you load you datagrid.
Hope it helps,
Random Solutions
Script to change CD-Rom drive letter
How to open old tethereal pcap files?
Cloud Computing
Trim() in JavaScript using Regular Expression
ASA 5505 DMZ won't Access Internet
IE error only, object doesn't support this property or method
Excel Interop: Find cell by name
Activesync through UAG
Blackberry Printing
transfering a directory with multiple files in parallel