calculation/rounding up or down

lyas

New member
Local time
Today, 13:38
Joined
Oct 6, 2008
Messages
8
In my report, I have it come up with a final calculation, but I need it to round it off to the nearest full number either up or down.

Is there a setting I am missing to allow it to do this?
One point can make a huge difference in first or second place.

Thanks,

=(120-(DSum("[total scratch]","[city horse league]","[name]='John'")/DSum("[games played]","[city horse league]","[name]='John'")))*0.8
 
Int() will round down to a real number. You loose all the decimal places for good.

Int((120-(DSum("[total scratch]","[city horse league]","[name]='John'")/DSum("[games played]","[city horse league]","[name]='John'")))*0.8 )

should work.
 
Int() will round down to a real number. You loose all the decimal places for good.

Int((120-(DSum("[total scratch]","[city horse league]","[name]='John'")/DSum("[games played]","[city horse league]","[name]='John'")))*0.8  )

should work.

Thanks so much, I about pulled all my hair out fighting with this.
Off to try it!!

thanks again.
 
I also see Roundup(num, 0) will round up to zero decimal places but I haven't used that but Int() I use a lot but I multiply the number by 100, Int() and then divide by 100 to give me true 2 decimal point number and not some number that shows as two places but in fact has 8 or 10 decimal points and then columns don't add up:(
 
gives me a syntax error :(

I added a screen shot of the error.
 

Attachments

  • error.jpg
    error.jpg
    22.2 KB · Views: 143
Look at the last part of your function. Should read *.8 without []

if still not working then just to test, create the query as you had it and then do a test query that gets the first query single field result and use Int() on that. but the end of your function is not right.
 
I see that the error message added those brakets...

here is what I have typed... its not working.

Thanks so much for your help and guidance..
 

Attachments

  • error2.jpg
    error2.jpg
    87 KB · Views: 117
Did it work before you added Int() ? if so , are you able to try the test query and just Int() the result without the long Dsum.

This works
YTDDep: Int(((([CurrentValue]*[AssetCategoryDepRate])/365)*[DepDays])*100)/100

which means I know Int() should work
 
Did it work before you added Int() ? if so , are you able to try the test query and just Int() the result without the long Dsum.

This works
YTDDep: Int(((([CurrentValue]*[AssetCategoryDepRate])/365)*[DepDays])*100)/100

which means I know Int() should work

I am doing all the calculations in report, not queries.
The calculation worked before I added the INT but it didn't round it up.
The extra point in the handicap results in a game changing point.

I believe you that INT works, I am just missing something in the calculations to make it correct.
:(
Will keep trying......
 
Just to be sure here. The calculation that works is in a query or report?

My use of Int() is always in a query - maybe it doesn't work in a report??

Can you do all the calculations in the query first and then leave the report to handle row totals and group totals etc.
 
Just to be sure here. The calculation that works is in a query or report?

My use of Int() is always in a query - maybe it doesn't work in a report??

Can you do all the calculations in the query first and then leave the report to handle row totals and group totals etc.


its all in report not query. The report refers to the table and picks up the numbers needed then does the calculation.
Not sure I can change the whole thing into a query.
It all worked out so good this way except for this one little glitch...
 
New one to me.

I always do my data collection and calculations in query first and when all is correct, make a report of the result.

Often the error message refers to [ ] () in the wrong place or one side missing but your last example appears ok - lets hope a more experienced member can assist.

What version are you using ?
 
New one to me.

I always do my data collection and calculations in query first and when all is correct, make a report of the result.

Often the error message refers to [ ] () in the wrong place or one side missing but your last example appears ok - lets hope a more experienced member can assist.

What version are you using ?


2000
ok well thanks for helping. I will go back to google and see what I can find.
 
I think when you use a function in a report you need to use = first.

Try =Int((120-(DSum("[total scratch]","[city horse league]","[name]='John'")/DSum("[games played]","[city horse league]","[name]='John'")))*0.8 )
 

Users who are viewing this thread

Back
Top Bottom