14
Answers

Join multiple tables

Nel

Nel

11y
1.6k
1

Hello,

I try connecting four tables for my OleDbCommand. The database I use is Ms Access.

Here is the commandtext I wrote:

string comstring1 = "Select Table1.Rbr, Table1.mbr, MATDAT.PRIME, SIFRAB.IMEZAN, ORGDAT6.IOE, Table1.sifra, Table1.nazivnatema, Table1.propisi,  Table1.datumod, Table1.datumdo, Table1.mesto,Table1.izveduvacnaobuka from MATDAT inner join Table1 on MATDAT.MBR=Table1.mbr join ORGDAT6 on MATDAT.PE=ORGDAT6.PE join SIFRAB on SIFRAB.RABMES=MARDAT.RABMES order by Table1.Rbr asc";


but when I run the windows forms application I get an error:

Syntax error (missing operator) in query expression 'MATDAT.MBR=Table1.mbr join ORGDAT6 on MATDAT.PE=ORGDAT6.PE join SIFRAB on SIFRAB.RABMES=MARDAT.RABMES'.          


Can anybody help me how to write the sql commandtext of the command correctly please?


Thank you in advance

Answers (14)