DataSource Select Statement with a subquery don't works

2 posts, 0 answers
  1. Cynthia
    Cynthia avatar
    11 posts
    Member since:
    Apr 2017

    Posted 04 Dec 2019 Link to this post

    Hi, I have a query with a subquery works fine on sql, but when I use it as select statement on Configure Data Source Command  in my telerik report, this not work correctly, the results make me think the subquery don't works

    This is my query in SQL

    select * from apc_AlmacenProductoTerminado a
    where a.SalidaAlmacen = 0 
    and not exists
    (select * from apc_AuditoriaALPC b
    where b.FechaHora = @FechaAuditoria
    and b.Boleta = a.Boleta)

    The Telerik Query Builder give me this:

    SELECT       a.Boleta, a.IdUsuario, a.FechaHora, a.Celda, a.Disponible, a.Vendido, a.SalidaAlmacen, b.NoEmpresa, b.Base, b.Boleta AS Expr1, b.Caja, b.NoCliente, b.Nombre, b.Camion, b.Fecha, b.HoraEntrada, b.HoraSalida, b.Familia, b.Material, 
                             b.Descripcion, b.Celda AS Expr2, b.Credito, b.Contado, b.PesoEntrada, b.Tara, b.Neto, b.Toneladas, b.Tarifa, b.Importe, b.Iva, b.Total, b.CostoTotal, b.Status, b.FechaFacturacion, b.FolioFactura, b.IdUsuario AS Expr3, b.NoGenerador, 
                             b.PesoCapturado, b.TaraCapturada, b.FolioPermiso, b.modificacion, b.firmado, b.firma, b.BasIN, b.BasOUT, b.UserIN, b.FolioFacturaContado
    FROM            apc_AlmacenProductoTerminado AS a INNER JOIN
                             Boletas AS b ON a.Boleta = b.Boleta
    WHERE        (a.SalidaAlmacen = 0) AND (NOT EXISTS
                                 (SELECT       Boleta, IDUsuario, FechaHora
                                   FROM             apc_AuditoriaALPC AS c
                                   WHERE         (FechaHora = @FechaAuditoria) AND (Boleta = a.Boleta)))


    But, when I run the report, the results not are correct, are there a restriction about this?

  2. Cynthia
    Cynthia avatar
    11 posts
    Member since:
    Apr 2017

    Posted 05 Dec 2019 in reply to Cynthia Link to this post

    I'm so sorry, I finded the mistake, is about the region settings on the Date. Thanks
Back to Top