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 in Query - but not a div by 0 - so what is it?



 
 
Thread Tools Display Modes
  #1  
Old March 7th, 2009, 03:17 PM posted to microsoft.public.access.queries
Katie Scott
external usenet poster
 
Posts: 1
Default #Error in Query - but not a div by 0 - so what is it?

Hello to all,

I am puzzling over a problem I'm having with a query that used to work and
now gives me a #Error. Even when I simplify it - it is a problem and I am
pulling my hair out trying to understand what's going on. Probably something
simple that I'm missing - but what???

If I try a comparison of two fields using IIF I get #Error everywhere.
ckSpike: IIf([SourceResult][Expected Value],1,0)
returns nothing but #Errors.

But if I just report the difference between the two values it's okay.
ckSpike2: [SourceResult]-[Expected Value]
returns
-787.6
-630
50
etc

?? What's wrong with comparing the two values with a sign? I do it all
the time elsewhere - and it used to work here....

Thanks for all your help!!!

Katie
  #2  
Old March 7th, 2009, 04:06 PM posted to microsoft.public.access.queries
Bob Barrows
external usenet poster
 
Posts: 475
Default #Error in Query - but not a div by 0 - so what is it?

One of them must contain a Null. Since they both appear to be numeric, use
Nz to force the nulls to 0.
IIf(Nz([SourceResult],0)Nz([Expected Value],0),1,0)


Katie Scott wrote:
Hello to all,

I am puzzling over a problem I'm having with a query that used to
work and now gives me a #Error. Even when I simplify it - it is a
problem and I am pulling my hair out trying to understand what's
going on. Probably something simple that I'm missing - but what???

If I try a comparison of two fields using IIF I get #Error everywhere.
ckSpike: IIf([SourceResult][Expected Value],1,0)
returns nothing but #Errors.

But if I just report the difference between the two values it's okay.
ckSpike2: [SourceResult]-[Expected Value]
returns
-787.6
-630
50
etc

?? What's wrong with comparing the two values with a sign? I do it
all the time elsewhere - and it used to work here....

Thanks for all your help!!!

Katie


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


  #3  
Old March 7th, 2009, 05:08 PM posted to microsoft.public.access.queries
Katie Scott[_2_]
external usenet poster
 
Posts: 1
Default #Error in Query - but not a div by 0 - so what is it?

Yes indeed!!! Thanks so much. That was driving me crazy!!!

Katie

"Bob Barrows" wrote:

One of them must contain a Null. Since they both appear to be numeric, use
Nz to force the nulls to 0.
IIf(Nz([SourceResult],0)Nz([Expected Value],0),1,0)


Katie Scott wrote:
Hello to all,

I am puzzling over a problem I'm having with a query that used to
work and now gives me a #Error. Even when I simplify it - it is a
problem and I am pulling my hair out trying to understand what's
going on. Probably something simple that I'm missing - but what???

If I try a comparison of two fields using IIF I get #Error everywhere.
ckSpike: IIf([SourceResult][Expected Value],1,0)
returns nothing but #Errors.

But if I just report the difference between the two values it's okay.
ckSpike2: [SourceResult]-[Expected Value]
returns
-787.6
-630
50
etc

?? What's wrong with comparing the two values with a sign? I do it
all the time elsewhere - and it used to work here....

Thanks for all your help!!!

Katie


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



 




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


All times are GMT +1. The time now is 07:06 AM.


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