Announcement

Collapse
No announcement yet.

change the sql code to a grid

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • change the sql code to a grid

    Hello everybody,

    Working with sql Server 2005 and have the following code:

    DECLARE @facturas nVARCHAR(250),@prv nVARCHAR(250),@poliza nVARCHAR(250)
    SELECT @facturas= COALESCE(@facturas + ', ','') + c_codigo_fac,
    @prv = COALESCE(@prv + ', ','') + c_codigo_prv,
    @poliza = COALESCE(@poliza + ', ','') + c_polizapago_fac
    FROM Mytable
    where c_codigo_sel='0000000681'
    select distinct c_codigo_sel,c_liq_cxp,@facturas as Facturas,@prv as Proveedores, @poliza as PolizasPago
    FROM Mytable
    where c_codigo_sel='0000000681'

    This code shows me the following output in sql:

    sql.jpg

    And the big question is: How can I make this code shows me the same result in a Grid?
    *
    I already tried changing the sql code, but I get an error

    I hope you can help me with this question

    Thanks!!!

    Nestor Avina
    Last edited by nesjam; 03-08-2014, 03:31 PM.
Working...
X