[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
Solved

Format and expression string on report

Posted on 2007-11-19
Medium Priority
679 Views
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
Question by:kdeutsch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 65

Expert Comment

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

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

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses
Course of the Month14 days, 8 hours left to enroll