Trouble with Calculated Field (whole number)

Novice1

Registered User.
Local time
Yesterday, 23:55
Joined
Mar 9, 2004
Messages
385
I have a calculated field in a report, which is as follows:

=IIf(IsNull([POI_E1A]),(([TodaysDate]-[EADDate])/365)/3,[A1]+[T2]+[A3]+[T4]+[A5]+[T6]+[A7]+[A8])

The calculation works fine; however, I only want to show the whole number (not rounded up; not rounded down). In other words, if the result is 0.9967, then I want 0 to appear.

I cannot figure out how to make this happen. In the properties section I ensured the format was "general number" with 0 decimal places but this didn't change the result. I tried changing the format in the calculated field, again, I wasn't successful.

Any help would be appreciated.
 
I have a calculated field in a report, which is as follows:

=IIf(IsNull([POI_E1A]),(([TodaysDate]-[EADDate])/365)/3,[A1]+[T2]+[A3]+[T4]+[A5]+[T6]+[A7]+[A8])

The calculation works fine; however, I only want to show the whole number (not rounded up; not rounded down). In other words, if the result is 0.9967, then I want 0 to appear.

I cannot figure out how to make this happen. In the properties section I ensured the format was "general number" with 0 decimal places but this didn't change the result. I tried changing the format in the calculated field, again, I wasn't successful.

Any help would be appreciated.

First Question, You said you don't want it to be rounded up or down.

Yet you use the example

"In other words, if the result is 0.9967, then I want 0 to appear"

That would be rounding down. - Can I ask what the difference between rounding up or down and completely not showing the decimals at all is?

The same thing is accomplished.

Sounds to me what you want is for it to be rounded down so that only the number left of the decimal point is shown.

Please clarify on your intentions. So that not only me but everyone else can get a better picture on what you are trying to achieve.
 
Check out the Int() function.
 
ConnerGiles ... sorry ... you are correct. I only want to show the number before the decimal point.
 
Int() function did the trick. Thank you very much
 
Happy to help. If your values can be negative, hopefully you saw the Fix() function while looking at Int().
 

Users who are viewing this thread

Back
Top Bottom