Calculated field :: Need an IIF statement?

T

Terence

Jason,

Write a IIF statement saying, IIf([Current_Price]= 0,
[Original_Price], [Original_Price]-[Current_Price])

I think the above should work.
 
T

Terence

Jason,

If you have $20.00 and you don't spend any of it during
the day (0), at the end of the day you should have $20.00.

The above is what my statement is doing.

Price_Reduction: [Original_Price]-[Current_Price]

If you have an amount is the original_price field beside 0
the outcome should not be 0, even if current_price equals
0. 20,000 - 0 = 20,000
-----Original Message-----
Hi Terence,

Your IIF did not seem to work so I reverted to Camerons Post which did
work....

Thanks
Jason
Jason,

Write a IIF statement saying, IIf([Current_Price]= 0,
[Original_Price], [Original_Price]-[Current_Price])

I think the above should work.
-----Original Message-----
I would appreciate help with an expression in the query builder of Access
2000:

I currently have a simple calculation field in my query which determines the
difference between two prices...

Price_Reduction: [Original_Price]-[Current_Price]

Works great....BUT....falls down when the Current Price is '0'.

EG:

20,000 - 0 = 20,000

Actually, if the Current_Price is Zero the Price_Reduction should = '0'

Like this:

Price_Reduction: 20,000 - 0 = 0 (No price reduction)

I guess it requires the use of perhaps an IIF statement but I am not
completely sure if this is correct. Can anyone give
me some guidance on how to construct this expression to reflect the reality
of the situation.?

Thanks in advance
Jason


.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top