24/07/2010, 13:47
|
| | Fecha de Ingreso: julio-2010
Mensajes: 1
Antigüedad: 14 años, 4 meses Puntos: 0 | |
error de sintaxis Hola a todos!! necesito ayuda con esta consulta
select B.Docdate, B.docduedate, B.taxdate,A.Cardcode, B.Cardname, B.docnum, B.Acctcode, B.ocrCode,
B.doctotal, C.Sumatoria From
(select t1.cardcode from OCRD t0 inner join OINV T1 on (t0.Cardcode=T1.cardcode)
where t0.cardtype='C') AS A
Left join
((select t1.docdate as 'Fecha de Contabilizacion' , t1.docduedate as 'Fecha de Vencimiento', t1.taxdate as 'Fecha de Documento',
t1. Cardcode as 'Codigo de Cliente', t1.Cardname as 'Nombre de Cliente', t1.docnum as 'Numero de documento',
t2. AcctCode as 'Cuenta de Mayor',t2.OcrCode as 'Centro de beneficio', t1.doctotal as 'Total deuda'
from OINV t1 inner join INV1 t2 on (t1.DocEntry=t2.Docentry) where t1.DocStatus = 'O')) AS B on (A.cardcode=B.cardcode)
left join
((select t1.cardcode, sum(t1.doctotal) as sumatoria from OCRD t0 inner join OINV t1 on (t0.Cardcode=t1.cardcode) where t0.cardtype='C'and t1.DocStatus = 'O' group by t1.cardcode)AS C on (C.cardcode=A.cardcode))
group by B.Docdate, B.docduedate, B.taxdate,A.cardcode, B.Cardname, B.docnum, B.Acctcode, B.ocrCode,
B.doctotal, C.Sumatoria
me muesta el siguiente error:
Mens. 156, Nivel 15, Estado 1, Línea 16
Sintaxis incorrecta cerca de la palabra clave 'on'.
Si alguien me puede ayudar se lo agradeceria!!! |