Excel with SQL where clause: too few parameters?

53 Views Asked by At

Does anyone know why this statement fails?

SELECT * FROM `U:\file1.xlsx`.`table1` a INNER JOIN `U:\file2.xlsx`.`table2` b ON a.ID=b.ID WHERE a.receipt = credit
// Result: Too few parameters. Expected:1 

It works without the WHERE clause, what am I doing wrong? I tried many versions (removing spaces, adding quotation marks etc.) but nothing helps.

1

There are 1 best solutions below

0
hitaxi On

Enclosed credit in quotes.

Use below query.

SELECT * FROM `U:\file1.xlsx`.`table1` a
   INNER JOIN `U:\file2.xlsx`.`table2` b
   ON a.ID=b.ID
   WHERE a.receipt = 'credit'