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

Another Division by Zero problem

Status
Not open for further replies.

kwj1027

IS-IT--Management
Aug 10, 2004
28
0
0
US
Greetings,

I am running CR 10 reporting running against reports in JDE.

Attempting to calculate the average time per piece for production.

Qty/Ttl Seconds with the formula:

if IsNull({@USE BY WO})
or Count ({@USE BY WO}) = 0 then 0 else
Count ({F57041.Q1$UNT}, {F57041.Q1TDTE}, "daily")/{@USE BY WO}

In this formula the @USE BY WO cannot be summarized so it does not work. Without the first two statements in the formula I receive the error message: "Division by zero"

I am calculating USE BY WO with the formula:

DateDiff ("s", Minimum ({F57041.Q1TDTE}, {F57041.Q1TDTE}, "daily"), Maximum ({F57041.Q1TDTE}, {F57041.Q1TDTE}, "daily"))

Hopefully I have provided the detailed information required. If not please let me know what I am lacking here.

Your assistance is greatly appreciated.

regards,

KJ

 
I do not understand your use of [red]{F57041.Q1TDTE}, "daily"[/red] as the 2nd and 3rd arguments of your maximum() and minimum() functions.

Where is this formula located?

If you are trying to get max and min by piece (part number?) then the 2nd argument should be the piece # field, no 3rd argument is required.


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Sorry was hoping that I had provided enough information.

IS the number of seconds between Min and Max of {F57041.Q1TDTE} resulting in formula calculation {@USE BY WO}.

{F57041.Q1TDTE} is from the detail of the report.

Count ({F57041.Q1$UNT}, {F57041.Q1TDTE} is the count of $UNT for each day.

My goal is to calculate the average time per unit from
Count ({F57041.Q1$UNT}, {F57041.Q1TDTE}, "daily")/{@USE BY WO}

Hope that explains it more 'clearly'.

Thanks in advance.
 
Amazing what the lack of sleep can do for a body and mind. I found my error when I came back to it - had an 'extra' count in the formula:

if IsNull({@USE BY WO})
or Count (SHOULD NOT BE HERE) ({@USE BY WO}) = 0 then 0 else
Count ({F57041.Q1$UNT}, {F57041.Q1TDTE}, "daily")/{@USE BY WO}

Thank you again for your time and efforts - just needed someone to listen to me talk myself through it.

Thank you DGILLZ!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top