Change numbers

  • Thread starter Thread starter Mary/Phil Stewart
  • Start date Start date
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
 
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])
 
Type something like this into the Field row of the query design grid:

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