🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.bd.ms-access
Article #89

Re: control de stock

#89
From: namor
Date: Wed, 13 Jun 2007 15:30
27 lines
2107 bytes
On 7 Mag, 10:35, estesiquev...@gmail.com wrote:
> hola,
>
> tengo una tabla de este estilo
>
> articulo, talla, color, movimiento, cantidad
> 1, s, rojo, compra, 1
> 1, s, rojo, venta, 2
> 1, m, verde, devolucion, 10
> ...
>
> y se trata de ver el número de artículos que hay para cada talla y
> color teniendo en cuenta que unos movimientos son positivos y otros
> negativos. vaya, un control de stock.
>
> cómo podría hacerlo?
> no se ni por donde empezar.
>
> gracias!

Una consulta como ese:
SELECT articulo, talla, color,
Sum([cantidad]*IIf([movimiento]="venta",-1,1)) AS Total
FROM Tabla
GROUP BY articulo, talla, color;
Hola.
-Marco-
Technical Details
Message-ID: <1181748618.411601.255890@g37g2000prf.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!g37g2000prf.googlegroups.com!not-for-mail
References: <1178526955.914568.47970@y5g2000hsa.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111a5a,182e0120dee1607b
X-Google-Attributes: gid111a5a,public,usenet
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!g37g2000prf.googlegroups.com!not-for-mail
From:  namor <marco.pizzamiglio@gmail.com>
Newsgroups: es.comp.bd.ms-access
Subject: Re: control de stock
Date: Wed, 13 Jun 2007 08:30:18 -0700
Organization: http://groups.google.com
Lines: 28
Message-ID: <1181748618.411601.255890@g37g2000prf.googlegroups.com>
References: <1178526955.914568.47970@y5g2000hsa.googlegroups.com>
NNTP-Posting-Host: 193.43.176.102
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1181748619 8969 127.0.0.1 (13 Jun 2007 15:30:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 13 Jun 2007 15:30:19 +0000 (UTC)
In-Reply-To: <1178526955.914568.47970@y5g2000hsa.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.0 cache.comune.gorizia.it:3030 (squid/2.6.STABLE5), 1.0 cache.comune.gorizia.it:3128 (squid/2.6.STABLE5), 1.0 proxy-sial (NetCache NetApp/5.5R5D8)
Complaints-To: groups-abuse@google.com
Injection-Info: g37g2000prf.googlegroups.com; posting-host=193.43.176.102;
   posting-account=B9ePPw0AAABt0BxZgPuU-MyTwZwHKaLa