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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Divide by Zero error (#Error) in Access SQL statement

Status
Not open for further replies.

Waxaholic

Technical User
Jan 31, 2001
63
US
I am getting a #Error result of an Access SQL statement. Is there some code i can use to default to a specific value, say "0", when this happens? Something to wrap the SQL in when this divide by zero error occurs and output the value "0" to the cell.

Thanks,

Brian
 
Hi Brian!

Say you have x/y, you can use this statement:

IIf(y=0, 0, x/y)

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top