My Assistant
![]() ![]() |
|
|
Jan 19 2012, 03:59 AM
Post
#1
|
|
|
UtterAccess Veteran Posts: 312 From: Melbourne, Australia |
I have a query that has a calculation field:
Sub Total: [Rate]*[Hrs] Works fine on whole or half numbers, but how do I get it to calculate on quarter? ie. 2.75 hours Apologies - probably basic know-how, but not my forte (IMG:style_emoticons/default/smile.gif) |
|
|
|
Jan 19 2012, 07:48 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 7,394 From: Oadby Leics, UK |
I don't understand the question.
The calculation should work for any values. Are you sure you are formatting the display in your form/report to show the full result? |
|
|
|
Jan 19 2012, 07:50 AM
Post
#3
|
|
|
UtterAccess VIP Posts: 8,104 From: CT |
how are those fields defined in the table?
|
|
|
|
Jan 19 2012, 09:07 AM
Post
#4
|
|
|
UA Forum + Wiki Administrator Posts: 11,946 From: Sudbury, Ontario, Canada |
Before doing the calculation you would have to 'round' the time factor to a quarter hour.
However, I included round in quotes because how you do it depends on the related business rule governing how you handle fractional hours. There are several possibilities:
Glenn |
|
|
|
Jan 19 2012, 07:39 PM
Post
#5
|
|
|
UtterAccess Veteran Posts: 312 From: Melbourne, Australia |
It's rounding the field, so the resulting calculation is not correct.
We only work with quarter hours (1.00, 1.15, 1.30, 1.45). I was incorrect above, it will still round if a half figure is input (1.5). The field is set to General Number and the decimal is auto. I've tried changing to Set Number with 2 decimal places, but its still rounding. I'm sure its something obvious ... (but not to me) (IMG:style_emoticons/default/smile.gif) This post has been edited by karenedmonds: Jan 19 2012, 07:40 PM |
|
|
|
Jan 19 2012, 08:53 PM
Post
#6
|
|
|
Utter A-fishin'-ado Posts: 17,723 From: Cincinnati, Ohio, USA . . . ><((((°> |
>>We only work with quarter hours (1.00, 1.15, 1.30, 1.45).<<
Could it be that you are mixing up minutes and percentages? 1.15 is NOT one and a quarter hours. It is one and fifteen - one hundredth hours. 1.25 is one hour and fifteen minutes expressed as a decimal. Could you provide some specific examples of the rounding effect? What are both values being multiplied? |
|
|
|
Jan 19 2012, 11:46 PM
Post
#7
|
|
|
UtterAccess Veteran Posts: 312 From: Melbourne, Australia |
Yeah, sorry, good point.
I am not the end user, but I did just clarify with them, and they are using it correctly (ie. .25 for each quarter hour). But that's not the problem. We have a field for Hours Worked [Hours] and another for the Rates Per Hour [Rate]. We often need to charge by quarter hour. I have tried various settings for this field including the formats and decimal spaces etc. I assumed it needs to be number or else it will not accept the calculation. However, I have just tried changing the [Hours] field to Text and now it seems to be calculating properly. Go figure! I will proceed to change the others (of which there are about 100!!) and let you know if this is the case (for anyone else's reference). |
|
|
|
Jan 20 2012, 03:43 AM
Post
#8
|
|
|
UtterAccess Addict Posts: 200 From: Chelsea, London, England |
It sounds like you had the field set to integer. Change that to single.
|
|
|
|
Jan 20 2012, 08:02 AM
Post
#9
|
|
|
UtterAccess Veteran Posts: 312 From: Melbourne, Australia |
You're right - thanks - didn't look there.
That works. Thanks everyone. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th May 2013 - 10:59 PM |