Foros del Web » Programación para mayores de 30 ;) » .NET »

Left outer join access - ADO.NET

Estas en el tema de Left outer join access - ADO.NET en el foro de .NET en Foros del Web. Hola hace un tiempo hize una consulta en sql expreess, y ahora necesito pasarla a access, segun le leido left outer join no funciona en ...
  #1 (permalink)  
Antiguo 28/11/2010, 10:24
Avatar de robertgustavo  
Fecha de Ingreso: marzo-2008
Ubicación: Camaná - Arequipa
Mensajes: 213
Antigüedad: 16 años, 1 mes
Puntos: 4
Left outer join access - ADO.NET

Hola hace un tiempo hize una consulta en sql expreess, y ahora necesito pasarla a access, segun le leido left outer join no funciona en access. ayuda please, este es el codigo

Cita:
@FechaInicio datetime,
@FechaFin datetime
As
Select P.Id
,P.descripcion
,P.categoria
,P.marca
,P.StockInicial
,isnull(J.Entrada,0)+ isnull(M.DevCliente,0)+ isnull(B.DevProveedor,0) Entradas
,isnull(S.Salida,0) Salidas
,isnull(J.Entrada,0)+ isnull(M.DevCliente,0)+ isnull(B.DevProveedor,0)+isnull(P.StockInicial,0)-isnull(S.Salida,0) SaldoFinal
From Productos P
Left outer join
(SELECT IDProducto,sum(Cantidad) as Salida
from DetalleVenta
Where fecha Between @FechaInicio and @FechaFin
Group by IdProducto) S
On P.Id = S.IdProducto
Left outer join
(SELECT IdProducto,sum(Cantidad) as Entrada
from DetalleCompra
Where fecha Between @FechaInicio and @FechaFin
Group by IdProducto) J
On P.Id = J.IdProducto
/*Aca de la devolucion de Clientes*/
Left outer join
(SELECT IDProducto,sum(Cantidad) as DevCliente
from DetalleDevolucion
Where fecha Between @FechaInicio and @FechaFin
Group by IdProducto) M
On P.Id = M.IdProducto
/*Aca de la devolucion de Proveedores*/
Left outer join
(SELECT IDProducto,sum(Cantidad) as DevProveedor
from DetalleDevolucionProveedores
Where fecha Between @FechaInicio and @FechaFin
Group by IdProducto) B
On P.Id = B.IdProducto
__________________
Soluciones basadas en .NET Framework y SQL Server

Etiquetas: access, join, left, outer, pasar
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:38.