Link to home
Start Free TrialLog in
Avatar of bhavesh55
bhavesh55

asked on

Compare variable's value in crystal......

I tried to wrote same formula in 2 different ways but unfortunately it didn't run.
It gives me below mentioned error when i try to preview my report.

1)Error: Numeric Overflow.

StringVar X;
If {table_site.x_site_group} = "Bldg" then
    X := chr({table_site.objid})
Else If {table_site.x_site_group} = "Tenant" then
    If chr({table_site.child_site2site}) = X then
        {table_site.name}
    Else
        ""
Else
    ""

2)Error:The String is non-numeric.

StringVar X;
If {table_site.x_site_group} = "Bldg" then
    X := chr({table_site.objid})
Else If {table_site.x_site_group} = "Tenant" then
    If {table_site.child_site2site} = ToNumber(X) then
        {table_site.name}
    Else
        ""
Else
    ""

Let me know as soon as you can.


Thanks for your time in advance.

Thanks,
bhavesh55
Avatar of 3rsrichard
3rsrichard

If you hit debug it might tell you what line caused the error.
Also it might help anyone trying to help you to know what the "types" of your data items are.

Guess 1)
Chr(charcode)
The required charcode argument is a Long that identifies a character.
table_site.objid could be something other than a long.

Guess 2)
X := is a Pascal construct, not VB


Do you need to know twice?
ASKER CERTIFIED SOLUTION
Avatar of 3rsrichard
3rsrichard

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bhavesh55

ASKER

3rsrichard
I am talking about crystal report not vb.

anyway, i will give you point.

Thanks,