Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

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

Posted on 2000-04-21
Medium Priority
203 Views
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,
bhavesh55
0
Question by:buddyp
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 3

Author Comment

ID: 2738342
All experts,

Thanks,
buddyp
0

Author Comment

ID: 2738421
All experts,

Thanks,
buddyp
0

Author Comment

ID: 2738476
All experts,

Thanks,
buddyp
0

LVL 1

Accepted Solution

prakashbitra earned 300 total points
ID: 2739370
hi buddyp,

initially when u create a variable it has some garbage value in it, so we have to assign a value to that variable X.

for ur code, first if statement will work good but when it reaches to else statement u r directly comparing the database field to a garbage value..

bye
happy working
0

LVL 18

Expert Comment

ID: 2740774
Hello,

I posted what I believe is the correct answer for you in one of the other two versions of this same question, but I'll post it here as well.  I think the problem is that you have used the chr function which is supposed to be used to convert one ascii value to one character, to try and convert a string.  To convert a number to a longer string, use the ToText function instead of the chr function.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
###### Suggested Courses
Course of the Month6 days, 4 hours left to enroll