Wrox Programmer Forums
|
BOOK: Beginning Access 2003 VBA
This is the forum to discuss the Wrox book Beginning Access 2003 VBA by Denise M. Gosnell; ISBN: 9780764556593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Access 2003 VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 11th, 2005, 04:03 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default Division by zero

I have what I thought was a simple formula that worked for over a month. Now when I run the query I’m getting a Division by zero error. The formula is shown below. If anyone can help me create a formula to work around the error or an idea as to how I can, that would great.

GM: ([P_CTRL_RETAIL])-([P_PRICE1])/([P_CTRL_RETAIL])

Thanks you

Corey

 
Old December 16th, 2005, 11:44 AM
Registered User
 
Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

is there any chance that the value of the [P_CTRL_RETAIL] field is actually zero? perhaps the field was set to zero accidentally--that would explain why it worked for over a month and suddenly stopped. sorry if this seems like an overly obvious suggestion.

 
Old April 13th, 2007, 02:56 PM
Registered User
 
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I learned the hard way - from Excel on up - anytime I do division I have to first check to see if the divisor value is either zero or NULL.

It's probably a good idea to use a case statement of an if/then (depending) to test the ([P_CTRL_RETAIL]) value first.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Division by zero error Corey Access 4 October 20th, 2005 12:51 PM
IIf Statement "division by zero" error Corey BOOK: Beginning Access 2003 VBA 5 September 30th, 2005 05:48 AM
division by zero rickjg JSP Basics 1 November 9th, 2004 08:03 AM
Performing Division in XSLT... Please help.. kiril XSLT 3 May 17th, 2004 05:27 AM
Division by zero error ss2003 Beginning PHP 5 January 1st, 2004 11:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.