Hasta ahora mi consulta la habia creado asi:
#define PRESUPUESTOS ;
"SELECT " + ;
"a.id as c1, " + ;
"a.idfactura as c2, " + ;
"a.fecha as c3, " + ;
"a.idcontacto as c4, " + ;
;
"b.id as c5, " + ;
"b.nombre as c6, " + ;
"b.telefono as c7, " + ;
;
"a.subtotal as c8, " + ;
"a.descuento as c9, " + ;
"a.total as c10 " + ;
;
"FROM tbfacturados a " + ;
"LEFT JOIN tbcontactos b " + ;
"ON a.idcontacto = b.id " + ;
"ORDER BY a.idfactura "
y quiero adaptarlo utilizando TEXT INTO.. ENDTEXT, como deberia de hacerlo?
he probado esto pero no me funciona.
- Code: Select all Expand view RUN
- TEXT into cSql
Select
SELECT
a.id as c1,
a.idfactura as c2,
a.fecha as c3,
a.idcontacto as c4,
b.id as c5,
b.nombre as c6,
b.telefono as c7,
a.subtotal as c8,
a.descuento as c9,
a.total as c10
FROM tbfacturados a
LEFT JOIN tbcontactos b
ON a.idcontacto = b.id
ORDER BY a.idfactura
ENDTEXT
oQry := ::oCnx:QUERY( cSql )
xbrowser oQry