- All Categories
- 73 General
- 73 Announcements
- 66.3K Microsoft Dynamics NAV
- 18.5K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 115 Navision DOS
- 854 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 615 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 247 Dynamics CRM
- 109 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 992 SQL General
- 385 SQL Performance
- 33 SQL Tips & Tricks
- 34 Design Patterns (General & Best Practices)
- Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 79 Testing
- 1.2K Download section
- 23 How Tos section
- 259 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

Mclaren
Member Posts: **47**

Hi Guys,

I have to a get a value from Two values. If I want to get X I want to get it like Y/Z. There is an issue. If Y and Z are Zero the X value Prints like "#ERROR". If Both the values are Zero I want to get X also as Zero. Can any one provide me a solution on this. Any help will be appreciated.

I have to a get a value from Two values. If I want to get X I want to get it like Y/Z. There is an issue. If Y and Z are Zero the X value Prints like "#ERROR". If Both the values are Zero I want to get X also as Zero. Can any one provide me a solution on this. Any help will be appreciated.

0

## Comments

2,998example:

if n <> 0 and m <> 0

n/m = x

if n= 0 and m <> 0

n/m = 0

if n<>0 and m = 0

division by zero: impossible

if n= 0 and m= 0

zero divided by zero: indefinite (i don't know if it's correct english)

the correct value for you should be ERROR (mathematically talking), but if you want zero if the division errors out, then just do

"Never memorize what you can easily find in a book".....Or Mibuso

My Blog

47How to write it under Value property of RTC Report?

2,998"Never memorize what you can easily find in a book".....Or Mibuso

My Blog

472,998I don't know how to explain you more than this :-k

"Never memorize what you can easily find in a book".....Or Mibuso

My Blog

47XXXXX.GET;

XXXXX.SETRANGE("Qty",XXXXX."Qty");

DecCost := XXXXX."Cost" * XXXXX."YQuantity";

IF (XXXXX."Qty" <> 0) THEN

DecPrice :=(DecCost/(XXXXX."Qty"))

ELSE

DecPrice := 1;

Can Some one provide me a solution on this. Any Help will be appreciated.

2,309So what does that tell you then? That the IF part of the statement is returning a FALSE, or XXXX.Qty is equal to zero. It's easy to check with the debugger.

My Blog - nav.education

15May be you need to double check the syntax of your code...

7,142also XXXXX.GET;

isn't getting anything unless it's some setup table

http://msdn.microsoft.com/en-us/library/dd338616.aspx

Harry Ruizhttp://www.BiloBeauty.comhttp://www.autismspeaks.org