Results 1 to 4 of 4

Thread: [RESOLVED] Divde by Zero? Strange Error.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    86

    Resolved [RESOLVED] Divde by Zero? Strange Error.

    I am getting a divide by zero error on this when I am calling it from VB.6 I am using Crystal 10.

    If {Sales.Suggestion} = 'Lower' Then
    Count ({Sales.Suggestion})

    But when I just do.
    Count ({Sales.Suggestion})
    Then I do not get that error.

    What is going on? Any ideas?

  2. #2
    Lively Member
    Join Date
    Mar 2006
    Posts
    94

    Re: Divde by Zero? Strange Error.

    Quote Originally Posted by vbjohn
    I am getting a divide by zero error on this when I am calling it from VB.6 I am using Crystal 10.

    If {Sales.Suggestion} = 'Lower' Then
    Count ({Sales.Suggestion})

    But when I just do.
    Count ({Sales.Suggestion})
    Then I do not get that error.

    What is going on? Any ideas?
    Is it possible that Sales.Suggestion might be null? If it is, then it'll throw an error trying to evaluate a null value without using IsNull.
    This is off the top of my head:
    if not IsNull({Sales.Suggestion} ) then
    If {Sales.Suggestion} = 'Lower' Then
    Count ({Sales.Suggestion})
    end if
    else
    0
    end if
    What are you trying to accomplish? Fill a text field?
    HTH
    Energy can be neither created not destroyed. It can only be wasted.

    Red Green

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    86

    Re: Divde by Zero? Strange Error.

    That did not work. Still get the error.

    What I am tring to do is...

    I have a few labels in the detail section and then right next to it I have the formula fields.

    For Ex: In the detail line.

    Lower: 1
    Middle: 0
    Higher: 5

  4. #4
    Lively Member
    Join Date
    Mar 2006
    Posts
    94

    Re: Divde by Zero? Strange Error.

    Quote Originally Posted by vbjohn
    That did not work. Still get the error.

    What I am tring to do is...

    I have a few labels in the detail section and then right next to it I have the formula fields.

    For Ex: In the detail line.

    Lower: 1
    Middle: 0
    Higher: 5
    Sorry then. That was the only thing I could think of when I read the post. What type of fields is the formula using eg. strings or integer or whatever? Oh yes try using double quotes " rather than single in the formula. I'm really grasping at straws here...
    Energy can be neither created not destroyed. It can only be wasted.

    Red Green

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width