update query

J

JIM.H.

Hello,
I have a table which has the field: qtyA, qtyB, orderQty,
qtyMin, orderMinQty
Now for each line, I want:
For orderQty; if(qtyA<=qtyB) then orderQty=qtyA else
orderQty=qtyA-qtyB endif
and
For orderMinQty; if((qtyB-qtyA) < qtyMin) then
orderMinQty=qtyMin else orderMinQty=0 endif

What is the fastest and easiest way to perform this on
each row.
Thanks,
Jim.
 
J

Jeff Boyce

Jim

The absolute fastest way to handle this is to ... not do it! What you
describe sounds like what you might do in a spreadsheet. In Access, there's
no need to store calculated values, and there are a lot of good reasons NOT
to (think synch, for one).

You've described the processing you need to embed in a query, to calculate
those values on-the-fly, whenever needed in a form or report. Just a
reminder -- in a query, you'll be using the IIF() function (which works
somewhat like an 'If ... Then ... Else' procedure).
 
Top