If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Adding controls
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 |
#2
|
|||
|
|||
Adding controls
Try =Int([Field1] + [Field2])
|
#3
|
|||
|
|||
Adding controls
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 http://I.Am/DougSteele (no e-mails, please!) "Jeff L" wrote in message ups.com... Try =Int([Field1] + [Field2]) |
#4
|
|||
|
|||
Adding controls
Thanks for that BUT doesn't INT just drop off the decimal points without any
rounding? Tony "Douglas J Steele" wrote in message ... 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 http://I.Am/DougSteele (no e-mails, please!) "Jeff L" wrote in message ups.com... Try =Int([Field1] + [Field2]) |
#5
|
|||
|
|||
Adding controls
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" wrote in message ... 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 http://I.Am/DougSteele (no e-mails, please!) "Jeff L" wrote in message ups.com... Try =Int([Field1] + [Field2]) |
#6
|
|||
|
|||
Adding controls
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 http://I.Am/DougSteele (no e-mails, please!) "Tony Williams" wrote in message ... Thanks for that BUT doesn't INT just drop off the decimal points without any rounding? Tony "Douglas J Steele" wrote in message ... 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 http://I.Am/DougSteele (no e-mails, please!) "Jeff L" wrote in message ups.com... Try =Int([Field1] + [Field2]) |
#7
|
|||
|
|||
Adding controls
Found a solution in a "fix" of a formula using an IIf statement
Thanks Tony "Tony Williams" wrote in message ... 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" wrote in message ... 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 http://I.Am/DougSteele (no e-mails, please!) "Jeff L" wrote in message ups.com... Try =Int([Field1] + [Field2]) |
Thread Tools | |
Display Modes | |
|
|