Adding controls

  • Thread starter Thread starter Tony Williams
  • Start date Start date
T

Tony Williams

Is there a way that I can have a calculated control that adds two numerical
figures with 3 decimal places but displays the answer as a whole number. In
other words I want the calculation to take into account the decimals but not
display the decimals on my form. I've tried setting the format to 0 decimals
places but that seems to ignore the decimals in my calculation.
Thanks
Tony
 
In case any of the fields are Null, it would be better to use:

=Int(Nz([Field1],0) + Nz([Field2],0))
 
Thanks for that BUT doesn't INT just drop off the decimal points without any
rounding?
Tony
Douglas J Steele said:
In case any of the fields are Null, it would be better to use:

=Int(Nz([Field1],0) + Nz([Field2],0))

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Jeff L said:
Try =Int([Field1] + [Field2])
 
For eg 4.6 and 5.6 formatted as 0 decimals gives 5 and 6 , total 11 but Int
(4.6+5.6) gives 10?
I want 4.6 + 5.6 to give me 10. Is that possible?
I know this is a strange request but I do have a good reason for wanting to
do this.
Thanks
Tony
Douglas J Steele said:
In case any of the fields are Null, it would be better to use:

=Int(Nz([Field1],0) + Nz([Field2],0))

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Jeff L said:
Try =Int([Field1] + [Field2])
 
True. You may want to use the Round function (but be aware that it uses
Banker's Rounding: .5 will always be rounded to the nearest even number,
whether that's up or down.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Tony Williams said:
Thanks for that BUT doesn't INT just drop off the decimal points without any
rounding?
Tony
Douglas J Steele said:
In case any of the fields are Null, it would be better to use:

=Int(Nz([Field1],0) + Nz([Field2],0))

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Jeff L said:
Try =Int([Field1] + [Field2])
 
Found a solution in a "fix" of a formula using an IIf statement>
Thanks
Tony
Tony Williams said:
For eg 4.6 and 5.6 formatted as 0 decimals gives 5 and 6 , total 11 but
Int (4.6+5.6) gives 10?
I want 4.6 + 5.6 to give me 10. Is that possible?
I know this is a strange request but I do have a good reason for wanting
to do this.
Thanks
Tony
Douglas J Steele said:
In case any of the fields are Null, it would be better to use:

=Int(Nz([Field1],0) + Nz([Field2],0))

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Jeff L said:
Try =Int([Field1] + [Field2])
 
Back
Top