|
|
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));
|
|
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)); >
|
|
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)); > >
|
|
|