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?