Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Div 0 problem 1

Status
Not open for further replies.

Joshy

Programmer
Mar 8, 2001
14
0
0
CA
Hi everyone, here a easy one... I got a expression in a query that goes
Gas Efficiency: [Energy Flow]*100/([Total Flow]*[Gas used])
On occasion the [Gas used] is none and of course the "div 0" error occurs.
Instead of filtering out that row of data completely, I want a dash (-) or (N/A) in the Gas Efficiency row whenever no gas is consumed.
what can I do?
thanks
josh
 
Hi!

Try:
iif(len([Gas used]& &quot;&quot;)<>0;[Energy Flow]*100/([Total Flow]*[Gas used]);&quot;-&quot;)

Roy-Vidar
 
Lets see if it's easy:

GasEfficiency:IIF([Gas Used] = 0, [Energy Flow]*100/([Total Flow],[Energy Flow]*100/([Total Flow]*[Gas used])

Give it a go....(total flow must also always have a value other than 0...!?!
Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top