Error on Printing Divided Values
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
-
this is math, not programming...
example:
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 doif m <> 0 then x := n/m else x := 0;
0 -
Tx Belias.
How to write it under Value property of RTC Report?0 -
Ya. U R Correct. But I have to perform Two functions. One is to Print X and One is IF Y and Z = 0 I have to print X also as 0. Please Belias Provide me a solution.0
-
I already provided it: create "x" variable in nav, calculate it with the code i wrote above, put the variable in the right section in classic client, set the expression of a textbox in the rdlc as =Fields!x.Value
I don't know how to explain you more than this :-k0 -
Hi I have tried this Codes to assign a value to DecPrice Variable.but Its executing the Else Part only.
XXXXX.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.0 -
Mclaren wrote:but Its executing the Else Part only.
So 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.0 -
"XXXXX.SETRANGE("Qty",XXXXX."Qty");"
May be you need to double check the syntax of your code...0 -
perhaps qty is a flowfield? then you need to use calcfields, it's hard to tell with the information given.
also XXXXX.GET;
isn't getting anything unless it's some setup table
http://msdn.microsoft.com/en-us/library/dd338616.aspx0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
