Sql String 2 Inner Join (1 Viewer)

fdesu

New member
Local time
Today, 04:22
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!
 

June7

AWF VIP
Local time
Yesterday, 23:22
Joined
Mar 9, 2014
Messages
5,470
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.
 

fdesu

New member
Local time
Today, 04:22
Joined
Aug 6, 2019
Messages
8
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;
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:22
Joined
Oct 29, 2018
Messages
21,467
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?
 

fdesu

New member
Local time
Today, 04:22
Joined
Aug 6, 2019
Messages
8
Is working now, it's a bit embarrassing it must have been a comma or a dot.

Thanks for the time!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:22
Joined
Oct 29, 2018
Messages
21,467
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

Top Bottom