como deberia de adaptar la nueva consulta con TEXT INTO

como deberia de adaptar la nueva consulta con TEXT INTO

Postby goosfancito » Wed Sep 29, 2021 3:36 pm

Hola.
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
 
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: como deberia de adaptar la nueva consulta con TEXT INTO

Postby nageswaragunupudi » Wed Sep 29, 2021 4:03 pm


Select
SELECT

You have used two selects.
Remove one.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: como deberia de adaptar la nueva consulta con TEXT INTO

Postby goosfancito » Wed Sep 29, 2021 4:52 pm

nageswaragunupudi wrote:

Select
SELECT

You have used two selects.
Remove one.


No me habia dado cuenta de ese error. gracias.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests