Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

division by zero

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kate - 11 Jul 2006 23:39 GMT
I get the DIVISION BY ZERO error when running this query.  The only thing
that changed was this query design:

OLD:
Specificity %: 100-(([Sum Of SumOfTrue (-)]/([Sum Of SumOfTrue (-)]+[Sum Of
SumOfFalse (+)]))*100)

Specificity %: (([Sum Of SumOfTrue (-)]/([Sum Of SumOfTrue (-)]+[Sum Of
SumOfFalse (+)]))*100)

Any of the SUM OF can have a value of 0.

Please help

Here is how my indiviual
Duane Hookom - 12 Jul 2006 04:26 GMT
Kate,
Consider using IIf() like:
SpecificityPct: IIf([some expression]=0,0, [Another Expression]/[Some
Expression])

Signature

Duane Hookom
MS Access MVP

>I get the DIVISION BY ZERO error when running this query.  The only thing
> that changed was this query design:
[quoted text clipped - 12 lines]
>
> Here is how my indiviual
K - 12 Jul 2006 10:48 GMT
So is this correct:

Specificity %: (IIF([Sum Of SumOfTrue (-)]0,0/IIF([Sum Of SumOfTrue (-)0,0+
IIF[Sum Of SumOfFalse (+)]0,0))*100)

So that for every expression [Sum of Sum???], I must use the IIF statement
in front of it  OR will just this work:

Specificity %: (IIF([Sum Of SumOfTrue (-)]0,0/([Sum Of SumOfTrue (-)]+[Sum Of
SumOfFalse (+)]))*100)

Thanks for your help,

> Kate,
> Consider using IIf() like:
[quoted text clipped - 17 lines]
> >
> > Here is how my indiviual
Duane Hookom - 13 Jul 2006 04:22 GMT
I don't see any "=0" in your expression like I had in mine. Also IIf is
always followed by a "(" like in my expression.

Signature

Duane Hookom
MS Access MVP

> So is this correct:
>
[quoted text clipped - 34 lines]
>> >
>> > Here is how my indiviual
Kate - 13 Jul 2006 15:47 GMT
Sorry:

Specificity %: IIF((([Sum Of SumOfTrue (-)]=0,0/([Sum Of SumOfTrue (-)]+[Sum
Of SumOfFalse (+)])))*100)  

Thanks,
K

> I don't see any "=0" in your expression like I had in mine. Also IIf is
> always followed by a "(" like in my expression.
[quoted text clipped - 37 lines]
> >> >
> >> > Here is how my indiviual
Duane Hookom - 13 Jul 2006 16:26 GMT
I had
   IIf(...=0, 0 , ....)
you have
   IIf(...=0, 0/... , ....)

I'm not sure what expressions you are dividing by what. I expect you need
something like:

Specificity %: IIf(    [Sum Of SumOfTrue (-)]=0,       0,    ([Sum Of
SumOfTrue (-)]+[Sum Of SumOfFalse (+)] ) *100/ [Sum Of SumOfTrue (-)] )

Your use of parens and symbols in field/column names makes your expression
difficult to understand.

Signature

Duane Hookom
MS Access MVP

> Sorry:
>
[quoted text clipped - 49 lines]
>> >> >
>> >> > Here is how my indiviual
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.