|
hi guys,
ive got an aspx page connecting to an MS ACCESS database.
im trying to do two left joins!
here is my code for one left join which works:
Dim sqlCmd2 = "SELECT ur.student_id, ur.unit_id, ur.award, aw.title " _
& "FROM UNITREG ur LEFT JOIN AWARD aw ON ur.award = aw.id " _
& "WHERE ur.student_id = '"& id &"' " _
& "ORDER BY aw.title"
i want to add a join to another table which i think should be something like this:
Dim sqlCmd2 = "SELECT ur.student_id, ur.unit_id, ur.award, aw.title, un.title " _
& "FROM UNITREG ur LEFT JOIN AWARD aw ON ur.award = aw.id, UNIT un " _
& "UNITREG ur2 LEFT JOIN UNIT un ON ur2.unit_id = un.id " _
& "WHERE (ur.student_id = '"& id &"')" _
& "ORDER BY aw.title"
i pritty sure im on the right lines but get thie following error:
Syntax error (missing operator) in query expression 'ur.award = aw.id UNITREG ur2 LEFT JOIN UNIT un ON ur2.unit_id = un.id'.
i prosume this means the i am not seperating my two join statements correctly.
i have tried "," and AND with no luck!
any ideas???????
__________________
regards,
Pauly.
The true sign of intelligence is not knowledge but imagination. (Albert Einstein)
Be who you are and say what you feel,
because those who mind don't matter and those who matter don't mind. (Dr. Seuss)
|