Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 13-02-2005
lgarcia lgarcia is offline
Miembro
 
Registrado: jul 2004
Posts: 479
Poder: 20
lgarcia Va por buen camino
Filtrado existencias en cero

Hola listeros:

Tengo el siguiente problema y es el relativo a una consulta en SQL Server 2000 donde tengo el siguiente codigo:
CREATE PROCEDURE InventarioTiendaCategoria
@tienda int,
@categoria int,
@fecha1 datetime,
@fecha2 datetime
AS
SELECT dbo.Inventario.CodTrasval, dbo.Inventario.DescripcionPLU, SUM(Existencia) AS existencia, dbo.Productos.precioventa
FROM dbo.Inventario INNER JOIN
dbo.Productos ON dbo.Inventario.codtrasval = dbo.Productos.codtrasval
WHERE tienda = @tienda and dbo.Inventario.categoria = @categoria and fecha between @fecha1 and @fecha2
GROUP BY dbo.Inventario.CodTrasval, dbo.Inventario.DescripcionPLU, dbo.Productos.precioventa
ORDER BY dbo.Inventario.DescripcionPLU

Al ser existencia un campo calculado SUM(Existencia) cuando lo pongo en el where existencia = 0 no me realiza ningun filtrado y salen todos lo valores con cero.

Alguien tiene solucion para eso.

Saludos
Luis Garcia
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 09:33:54.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi