Problem with Query, Help!

  • Thread starter Thread starter Teofilo Homsany
  • Start date Start date
T

Teofilo Homsany

Hi! I wrote the following Query and I keep getting an error for a missing
operator. I don't know what could be wrong. Any suggestions?
QUERY:
SELECT t.Secuencia as secuencia, c.[Nombre de la Compañía] as compania,
p.[Nombre del Período] as periodo, t.[Fecha transacción] as fechatrans,
d.[Nombre Corto] as documento, t.Documento as codigo, t.Débitos as
debitos,
t.Créditos as creditos, cl.[Nombre del Cliente] as cliente,t.[Fecha
Procesado] as fechaproc
FROM Transacción t
INNER JOIN Documentos d
on t.[Tipo de Documento] = d.[Tipo de Documento]
INNER JOIN Cliente cl
on t.Cliente = cl.Cliente
INNER JOIN Compañía c
on t.Compañía = c.Compañía
INNER JOIN Períodos p
on t.Período = p.Período
WHERE t.Secuencia = 750

ERROR:
Syntax error (missing operator) in query expression 't.[Tipo de Documento] =
d.[Tipo de Documento] INNER JOIN Cliente cl on t.Cliente = cl.Cliente INNER
JOIN Compañía c on t.Compañía = c.Compañía INNER JOIN Períodos p on
t.Período = p.Período'.

Thanks much in advance,
Teo
 
If this is an Access query, then you need to add parentheses in your multiple
joins. Access requires the parenthese when there are more than two tables
involved in the joins. I am guessing that you would need parentheses like the following.

SELECT t.Secuencia as secuencia, c.[Nombre de la Compañía] as compania,
p.[Nombre del Período] as periodo, t.[Fecha transacción] as fechatrans,
d.[Nombre Corto] as documento, t.Documento as codigo, t.Débitos as
debitos,
t.Créditos as creditos, cl.[Nombre del Cliente] as cliente,t.[Fecha
Procesado] as fechaproc
FROM (((Transacción t
INNER JOIN Documentos d
on t.[Tipo de Documento] = d.[Tipo de Documento])
INNER JOIN Cliente cl
on t.Cliente = cl.Cliente)
INNER JOIN Compañía c
on t.Compañía = c.Compañía)
INNER JOIN Períodos p
on t.Período = p.Período
WHERE t.Secuencia = 750

If this doesn't work for you, try removing ALL the joins and switching to the
query grid view. Then you can rejoin the tables by dragging from one table
field to its corresponding field in the other table. After doing this, you can
switch back to the SQL view and see where Access has placed the parentheses.
 
Back
Top