Page 1 of 1

Please help me resolving the -802 error

PostPosted: Wed Sep 12, 2012 3:19 pm
by sathiyendran.erulan
One of the field declared as decimal(9,0) called cust_nbr in table abc.
05 l-number-cnt pic s9(4) comp-4.

I need to get first or last four digits matched records from table abc. Example: when the user enters, 1234 , i need to get the cust_nbr which starting with 1234 and also ending with 1234.
Logic:
For getting the starting value, we can set the range that 123400000 to 123499999. This works fine.
For gettitng the ending value, we are using MOD function to match the ending value. MOD(cust_nbr, 10000)=1234

Query used:
select count(*) into l-number-cnt from abc where ( cust_nbr between 123400000 and 123499999
and MOD(cust_nbr, 10000)=1234 )
order by cust_name;

When i execute the query, i am getting -802 error. Reply me if you have any idea on this.

Re: Please help me resolving the -802 error

PostPosted: Wed Sep 12, 2012 4:59 pm
by Akatsukami
Another shotgun posting across multiple boards, eh?