Error on Printing Values

Mclaren
Member Posts: 47
Hi Guys,
There is an issue while I was Print decimal values. For eg:- (It just an example)
I want to get an Amount call X from dividing SUM(CustLedgEntry.Amount) divided by SUM(CustLedgEntry.Quantity).
And One condition is IF the Both values getting divided are Zero the X value also want to be Zero. I wrote the Equation for get the divided value. If the both Values are Zero it prints "#ERROR". Can some one provide me a solution to escape from this issue.Any help will be appreciated.
There is an issue while I was Print decimal values. For eg:- (It just an example)
I want to get an Amount call X from dividing SUM(CustLedgEntry.Amount) divided by SUM(CustLedgEntry.Quantity).
And One condition is IF the Both values getting divided are Zero the X value also want to be Zero. I wrote the Equation for get the divided value. If the both Values are Zero it prints "#ERROR". Can some one provide me a solution to escape from this issue.Any help will be appreciated.
0
Comments
-
What about this post?
viewtopic.php?f=32&t=49786
Did you not like the answer you you asked it again?
if value1 = 0 or value2 = 0
then result = 0
else result = value1/value2
then you use the variable "result" as the sourceexp of the textbox in your report.0 -
Yes. I didn't got the answer which I expected. Its an urgent need. Thatz why I posted it again. Can You please help me???????0
-
He gave you the correct answer so what else were you expecting?
If it's urgent then you need to hire a professional to do it for you.
the advise here is free and you shouldn't expect anything within a specific time period.
If the answer you are looking for is "I'll do it for you for free" then this isn't the correct forum for you.
You've been given the direction you need to take, now you need to take that advice and try it yourself.
Just use your logic, this isn;t a difficult task to handle a zero value while dividing.
What part of the code in Belias' first post didn't help?0 -
Mclaren wrote:Yes. I didn't got the answer which I expected. Its an urgent need. Thatz why I posted it again. Can You please help me???????
Putting urgent in your message is not the right way to get a response in this forum.
Please see Forum Rule(s) #3.2: Forum Rules.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
just trying to figure it out what could be the reported problem of Mclaren, I guess that he doesn't fully understand the basic programming, where any type of number that divided by zero will generate an error message, and to get rid of the error message is to add a condition such as if divisor is zero then assigned X value to zero.
Value1 :=CALCSUMS(CustLedgerEntry.Amount);
Value2 :=CALCSUMS(CustLedgerEntry.Quantity);
IF value1=0 or value=0 then
X:=0
ELSE
X:=Value1/Value2;0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 320 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