Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

two minuses dont make a right?? 3

Status
Not open for further replies.

drussum

Programmer
Jan 31, 2002
38
US
Ok, here we go, I have one field minus one field equals another, More specific: [Ordered Quan]-[Delevered Quan]= [Back Order]. The problem I am running into is that when I have two minuses for example, "[Ordered quan]" is minus one and "[Delevered Quan]" is minus one, then back order is also minus one. What I need is to have back order read "0" Does anyone know how to do this?
 
How can an ordered quantity be minus one? Unless it is a credit.

If it is a credit then it should not be in your orders table, it shoud be in a credit table.
 
Thanks for the reply, I understand what you are saying, This is not an accounting question. I only want the syntax to apply so that when there are two minuses then the back order is "0".

 
Assuming you *only* want to do this where *both* are minus, try this:

Iif([Ordered Quan] < 0 And [Delevered Quan] < 0, 0, [Ordered Quan]-[Delevered Quan])

Bev
 
Hmmmmmmmmmmmmmmmmmm,

and Hmmmmmmmmmmmmmmmmm,

Again.


It works like I would think it should and as you state for MY system. Taking a small liberty to avoid constructing YAT (Yet another Table):

Code:
OrQuan = -1
DelvQuan = -1
? OrQuan, DelvQuan
-1            -1 
BkOr = OrQuan - DelvQuan
? BkOr
 0 
[code]
 MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Thanks for your help some times there is not always two minuses sometimes there is only one. would this still work?
 
If I'm interpreting you correctly, what you really want to do is show zero (0) if [Ordered] - [Delivered] is a negative number. Bev is on the right track. What I would do is make the source for [BackOrder] the following:

= iif([Ordered Quan]-[Delevered Quan]< 0, 0, [Ordered Quan]-[Delevered Quan])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top