2008 Jun 09 3:56 PM
Hi all,
I have the follow SELECT statement:
SELECT SINGLE * FROM table1 INTO wa1
WHERE
field1 = var1;
The problem is that field1 DataType is CHAR10 and var1 DataType is I. So if field1 contains '0123' and var1 = '123' the SELECT fails.
Is there any way to consider field1 as an Integer?
Best Regards,
Raffaele
Hi all,
I have the follow SELECT statement:
SELECT SINGLE * FROM table1 INTO wa1
WHERE
field1 = var1;
The problem is that field1 DataType is CHAR10 and var1 DataType is I. So if field1 contains '0123' and var1 = '123' the SELECT fails.
Is there any way to consider field1 as an Integer?
Best Regards,
Raffaele
2008 Jun 09 3:58 PM
No, but you could move var1 to a type n variable to get the leading zeros and then compare with that variable
2008 Jun 09 4:28 PM
No, but you could move var1 to a type n variable to get the leading zeros and then compare with that variable
It doesn't work because I don't know how many zeros are in the field1.
Best Regards,
Raffaele
2008 Jun 09 4:03 PM
hi,
do this way ..Convert it to char data type
data : var1 like table1-field1 value '0123'.
SELECT SINGLE * FROM table1 INTO wa1
WHERE
field1 = var1.
2008 Jun 09 4:44 PM
use the FM : CONVERSION_EXIT_ALPHA_OUTPUT to quit the zeros of any variable.
example
if u have 000945
after call FM u obtain only 945
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |