Solved

Format and expression string on report

Posted on 2007-11-19
3
668 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
[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
  • Learn & ask questions
  • 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Menus 6 49
Handle Apostrophes in SQL Parameter 16 60
Select category, subcategory in MS Access table field 7 35
updating subform when combobox is updated 4 7
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

736 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