A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Error Results in Query



 
 
Thread Tools Display Modes
  #1  
Old September 1st, 2005, 07:56 PM
Sherry N.
external usenet poster
 
Posts: n/a
Default #Error Results in Query

Hello,
I expect my query to return some #Error results b/c there is division
involved with 0. What I would like to do is create some kind of statement in
the criteria that would say If result "#Error", then result should be "0".
Any help greatly appreciated.

Thanks.
--
Sherry N.
  #2  
Old September 1st, 2005, 08:30 PM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

Use an IIf function to produce a zero when the divisor is zero. If you show
us an example of the calculation in your query, we can suggest an example of
such IIf usage.

--

Ken Snell
MS ACCESS MVP

"Sherry N." wrote in message
...
Hello,
I expect my query to return some #Error results b/c there is division
involved with 0. What I would like to do is create some kind of statement
in
the criteria that would say If result "#Error", then result should be "0".
Any help greatly appreciated.

Thanks.
--
Sherry N.



  #3  
Old September 1st, 2005, 08:42 PM
Ofer
external usenet poster
 
Posts: n/a
Default

You can check the field you dividing on, and if it equal to zero then return
zero, else run the devision

IIf(FieldName=0,0,Field2Name/FieldName)


"Sherry N." wrote:

Hello,
I expect my query to return some #Error results b/c there is division
involved with 0. What I would like to do is create some kind of statement in
the criteria that would say If result "#Error", then result should be "0".
Any help greatly appreciated.

Thanks.
--
Sherry N.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Toolbars, Drop-Down Menus Rick New Users 1 September 21st, 2005 11:17 AM
SQL query showing diff between actual and budget Bon Running & Setting Up Queries 3 August 25th, 2005 12:07 PM
Nested in-line Query laura Running & Setting Up Queries 0 February 11th, 2005 12:17 AM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Display Parameter from Form on Report sara Setting Up & Running Reports 10 July 19th, 2004 04:54 PM


All times are GMT +1. The time now is 09:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.