Sql String 2 Inner Join

fdesu

New member
Local time
Today, 12:07
Joined
Aug 6, 2019
Messages
8
Hi there,
I'm working in sql string, but i can't make it work, but in MS Access report work fine.

I have this problem only in VBA when im using 2 Inner Join,but with 1 no problem.

Set rs = CurrentDb.OpenRecordset ("SELECT * FROM despachos INNER JOIN clientes ON despachos.id_cliente = clientes.id_cliente INNER JOIN localidad ON despachos.id_localidad = localidad.id_localidad")

VBA Error: Error Syntax.

What am i missing?

Thanks

Regards!
 
Build the query in Access and then use SQLView to see structure. I think need a pair of parens around join clause. Access will provide them.
 
Build the query in Access and then use SQLView to see structure. I think need a pair of parens around join clause. Access will provide them.

Hi June7,
Thanks for you help.

This is with SQLView, I try with it too, but i have the same result.

SELECT *
FROM (despachos INNER JOIN clientes ON despachos.id_cliente = clientes.id_cliente) INNER JOIN localidad ON despachos.id_localidad = localidad.id_localidad;
 
Hi June7,
Thanks for you help.

This is with SQLView, I try with it too, but i have the same result.
Hi. If you copied and pasted the query's SQL view into your code, can we please see exactly how you did it? What does the final code look like now?
 
Is working now, it's a bit embarrassing it must have been a comma or a dot.

Thanks for the time!
 
Is working now, it's a bit embarrassing it must have been a comma or a dot.

Thanks for the time!
Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom