Hello Experts:
I need some assistance with generating a query that outputs 100% even if the denominator = 0.
Attached are two (2) samples files illustrating the process when using a) "number of records" vs. b) "field data type = NUM".
Version 01:
- Attached DB file includes table with 10 sample records where [CONCURRENCE] includes 2 values {Concur, Non-Concur}.
- Query "Q01" and "Q02" calculate the numerator and denominator, respectively.
- Lastly, "Q03" outputs the desired percentages for both "Concur" and "Non-Concur".
Version 02:
- FYI purposes only, I've included table/query "T_DivideByZero" and "Q_DivideByZero" that demonstrate the work around using an expression when "field data type = NUM".
- However, just like in version 01, I need to output the percentage breakdown based on a query that returns # of records.
- So, in this DB, all 10 sample records have [CONCURRENCE] = "Concur".
- Thus, query "Q02" does NOT return any records.
- And, consequently, "Q03" also does NOT return the desired output of, e.g., "100%", "0%".
My question:
- Just like with the "After: IIf([Denominator]=0,1,[Numerator]/[Denominator])" expression in query "Q_DivideByZero", does anyone know of a work-around for the denominator query "Q02" so that the "divide by zero" won't be an issue for "Q03"?