Solved

Format and expression string on report

Posted on 2007-11-19
3
664 Views
Last Modified: 2013-11-28
I have a report in which I put a text box that returns the average.  (Done for me)  However I forgot to make sure that it rounds up.  I tried to format it but cant seem to get it correct.  here is the expression
=sum(IIF([expr4]<>0,[expr4],0))/sum(IIF([expr4]<>0,1,0))  Need to round to next # if it has decimals

Thanks
0
Comment
Question by:kdeutsch
  • 2
3 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 20314421
u could try round around everything

=ROUND(sum(IIF([expr4]<>0,[expr4],0))/sum(IIF([expr4]<>0,1,0)),0)

0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 20314454
Dont think there is a round up as such in access however you can fiddle it in VBA i.e.

dim dbl x as double
dim intx as integer
dblx = sum(IIF([expr4]<>0,[expr4],0))/sum(IIF([expr4]<>0,1,0))
intx = round(dblx ) + iif(round(dblx )< dblx ,1, 0)

Chris
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 125 total points
ID: 20314599
Timely reminder from Chris :)

I forgot the 0.5 in my rounding, ha

=ROUND(sum(IIF([expr4]<>0,[expr4],0))/sum(IIF([expr4]<>0,1,0))+0.5,0)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now