Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 07-15-2005, 12:15 PM   #1
Member (9 bit)
 
Join Date: Nov 2002
Posts: 502
Access 2003 query question

I have this query that is duplicating values of the table [Detalle Compra], for each recorset of Sum(Nz([Cant_vendida],0)) it place a record of Sum(Nz([Cantidad_Ent],0)) for example if I have only one entry of 6 and three outs of one, two and three it does this

Entries outs

6 1
6 2
6 3


SELECT [Detalle compra].ID_Producto, [Catalogo de Articulos].Descripcion_Productos, Sum(Nz([Cantidad_Ent],0)) AS Entradas, Sum(Nz([Cant_vendida],0)) AS Salidas, Sum(Nz([Cantidad_Ent],0)-nz([Cant_vendida],0)) AS Existencia, [Tipos de Articulos].[Tipo de Articulo]
FROM [Tipos de Articulos] INNER JOIN (([Catalogo de Articulos] LEFT JOIN [Detalle compra] ON [Catalogo de Articulos].ID_Productos = [Detalle compra].ID_Producto) LEFT JOIN [Detalle Facturas] ON [Catalogo de Articulos].ID_Productos = [Detalle Facturas].ID_Articulo) ON [Tipos de Articulos].ID_Tipo_Art = [Catalogo de Articulos].Tipo_articulo
GROUP BY [Detalle compra].ID_Producto, [Catalogo de Articulos].Descripcion_Productos, [Tipos de Articulos].[Tipo de Articulo]
HAVING ((([Tipos de Articulos].[Tipo de Articulo])="Articulo"));



There is an attach with the image of the query desing
Attached Images
File Type: jpg Nueva imagen.jpg (26.6 KB, 60 views)
easg is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 04:53 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2