Rounding in caculated field (1 Viewer)

cpberg1

It's always rainy here
Local time
Today, 10:18
Joined
Jan 21, 2012
Messages
79
Let me just start with a :banghead:

I'm trying to get a query to perform a calculation and round the results.

The fields that I am running the calculation and am trying to round are Data Type Number, properties Field size Single and decimal places Auto.

I have tried the built in function described in Allen Browne's site to no avail.
http://allenbrowne.com/round.html

I have tried rounding the individual fields and then adding result.
I have also tried rounding the result (as attached).

Any thoughts?
 

Attachments

  • Query example.png
    Query example.png
    25.5 KB · Views: 112

cpberg1

It's always rainy here
Local time
Today, 10:18
Joined
Jan 21, 2012
Messages
79
also, will re-name the calculated field "time" to LessonTime. So as to avoid restricted words.
 

ypma

Registered User.
Local time
Today, 18:18
Joined
Apr 13, 2012
Messages
643
The use of the Single data type is not recommended for rounding . Is changing to Double and option you could use ? as you example would then work . I have found that floating point numbers a little tricky to use.

regards Ypma
 

spikepl

Eledittingent Beliped
Local time
Today, 19:18
Joined
Nov 3, 2010
Messages
6,142
There is presumably an issue, problem or question here. So what is it?
 

ypma

Registered User.
Local time
Today, 18:18
Joined
Apr 13, 2012
Messages
643
There is presumably an issue, problem or question here.
So what is it?
My understanding is that the issue is that the Rounding function to one decimal point fails to work when using Single number data types, The question is that the Op would like to know why ?

Regards Ypma
 

spikepl

Eledittingent Beliped
Local time
Today, 19:18
Joined
Nov 3, 2010
Messages
6,142
Define "failure" - this normally involves some expectation AND some result not matching that expection. There is nothing in the post indicating any software failure or problem. As to the expectations I'd rather not guess so I ask.
 

ypma

Registered User.
Local time
Today, 18:18
Joined
Apr 13, 2012
Messages
643
Define "failure

The post clearly show the use of the function Round with the expectation of a answer to one decimal point, and the result is clearly not what was expected, as shown in the png , so I am at a loss as to why we are not trying help him/her instead of worrying about defining words.

Regards Ypma
 

JHB

Have been here a while
Local time
Today, 19:18
Joined
Jun 17, 2012
Messages
7,732
..
I'm trying to get a query to perform a calculation and round the results.
...
In query design, mark the field/column "Time", ("LessonTime"), and set the property "Format" = "Fixed" and the "Decimal place" = "1"
 

ypma

Registered User.
Local time
Today, 18:18
Joined
Apr 13, 2012
Messages
643
JHB, Not my post but have learned something thank you,

Regards Ypma
 

cpberg1

It's always rainy here
Local time
Today, 10:18
Joined
Jan 21, 2012
Messages
79
In query design, mark the field/column "Time", ("LessonTime"), and set the property "Format" = "Fixed" and the "Decimal place" = "1"

JHB, Thank you for the guidance. Worked like a charm, and I learned something also!
 

cpberg1

It's always rainy here
Local time
Today, 10:18
Joined
Jan 21, 2012
Messages
79
Define "failure" - this normally involves some expectation AND some result not matching that expection. There is nothing in the post indicating any software failure or problem. As to the expectations I'd rather not guess so I ask.

Spike, thank you for the reminder to define the failure (expectation and result) clearly.
 

Users who are viewing this thread

Top Bottom