Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Query

Geek News

Query
h3llz 12/10/2008 9:17:03 PM
I've got this inside a query, but i want to add a WHERE, which only when
quantity isnt a negative value, (quantity within tblProductsLog can be 10 or
-10). Any suggestions?

SELECT tblProducts.productID, tblProducts.product, tblProducts.price,
tblProducts.staffID, tblProducts.productType, tblProducts.deleted,
Sum(tblProductsLog.quantity) AS quantity, tblProducts.reduction
FROM tblProducts INNER JOIN tblProductsLog ON tblProducts.productID =
tblProductsLog.productID
GROUP BY tblProducts.productID, tblProducts.product, tblProducts.price,
tblProducts.staffID, tblProducts.productType, tblProducts.deleted,
tblProducts.reduction
HAVING (((tblProducts.deleted)=No));

RE: Query
Dorian 12/10/2008 10:47:01 PM
Look up the syntax of the SELECT clause in Access Help - it will show you
where to put the WHERE clause.

-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"h3llz" wrote:

[Quoted Text]
> I've got this inside a query, but i want to add a WHERE, which only when
> quantity isnt a negative value, (quantity within tblProductsLog can be 10 or
> -10). Any suggestions?
>
> SELECT tblProducts.productID, tblProducts.product, tblProducts.price,
> tblProducts.staffID, tblProducts.productType, tblProducts.deleted,
> Sum(tblProductsLog.quantity) AS quantity, tblProducts.reduction
> FROM tblProducts INNER JOIN tblProductsLog ON tblProducts.productID =
> tblProductsLog.productID
> GROUP BY tblProducts.productID, tblProducts.product, tblProducts.price,
> tblProducts.staffID, tblProducts.productType, tblProducts.deleted,
> tblProducts.reduction
> HAVING (((tblProducts.deleted)=No));
>
RE: Query
Dale Fye 12/11/2008 1:52:12 PM
Sometimes the best way to teach is by example. Then explain the solution.

;-)

--
Dale

email address is invalid
Please reply to newsgroup only.



"Dorian" wrote:

[Quoted Text]
> Look up the syntax of the SELECT clause in Access Help - it will show you
> where to put the WHERE clause.
>
> -- Dorian
> "Give someone a fish and they eat for a day; teach someone to fish and they
> eat for a lifetime".
>
>
> "h3llz" wrote:
>
> > I've got this inside a query, but i want to add a WHERE, which only when
> > quantity isnt a negative value, (quantity within tblProductsLog can be 10 or
> > -10). Any suggestions?
> >
> > SELECT tblProducts.productID, tblProducts.product, tblProducts.price,
> > tblProducts.staffID, tblProducts.productType, tblProducts.deleted,
> > Sum(tblProductsLog.quantity) AS quantity, tblProducts.reduction
> > FROM tblProducts INNER JOIN tblProductsLog ON tblProducts.productID =
> > tblProductsLog.productID
> > GROUP BY tblProducts.productID, tblProducts.product, tblProducts.price,
> > tblProducts.staffID, tblProducts.productType, tblProducts.deleted,
> > tblProducts.reduction
> > HAVING (((tblProducts.deleted)=No));
> >

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net