Change numbers

M

Mary/Phil Stewart

I run a query in Access 2k that has a calculating field. Here I subtract
field2 from field1. If the answer is a negative number, which happens often,
I would like the answer in the result field to be 0, zero, rather than the
negative number.
Any advice will be greatly appreciated.
Thanks,
Phil
 
F

fredg

I run a query in Access 2k that has a calculating field. Here I subtract
field2 from field1. If the answer is a negative number, which happens often,
I would like the answer in the result field to be 0, zero, rather than the
negative number.
Any advice will be greatly appreciated.
Thanks,
Phil
Phil,
Set the Format property of the control to:
#;0;0
Look up Format + Number and Currency Datatype
in Access help.

Alternatively, you could use an expression in an Unbound control:
=IIf[Field1]-[Field2]<=0,0,[Field1]-[Field2])
 
A

Allen Browne

Type something like this into the Field row of the query design grid:

IIf(([field1] - [field2]) < 0, 0, [field1] - [field2])
 

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