Calculating percentage

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am calculating a percentage from two queries that count data.
The first query calculates the total orders [Total].
The second query calculates the number of orders that failed to process
[Failed].

When my third query attempts to perform the percentage calculation:
FailedItems:[Failed]\[Total]

It returns wither 100% or 0%. As if it thinks that I am dealing with
integers or something. I can see examples where this works. Help! TIA.
Mike
 
Backslash performs integer division.

Try:
FailedItems: [Failed] / [Total]

Of course, that will still error if Total is zero.
 
Thank you Allen! Perfect! (old C programming skills bleeding through...)

Allen Browne said:
Backslash performs integer division.

Try:
FailedItems: [Failed] / [Total]

Of course, that will still error if Total is zero.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Mike said:
I am calculating a percentage from two queries that count data.
The first query calculates the total orders [Total].
The second query calculates the number of orders that failed to process
[Failed].

When my third query attempts to perform the percentage calculation:
FailedItems:[Failed]\[Total]

It returns wither 100% or 0%. As if it thinks that I am dealing with
integers or something. I can see examples where this works. Help! TIA.
Mike
 
Back
Top