Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SELECTING DEC 8 2. value from DB ? ( Decimal places contains some value )

Former Member
0 Kudos

There is a table in which one field is of type DEC 8 2.

I have to select all records for which this field can have decimal places( I mean decimal places have some value instead of '00' ).

How to write my SELECT stmt ?

For eg 12.00 , 657.00, 123.12...

I need to SELECT only 123.12 value .

Could you please suggest me how can I SELECT those values in my SELECT stmt ?

Thanks,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I dont think you can restrict this condition in select qery. Better you can fetch all the records into an int table and then delete which have 00 decimals.

first select all the data in itab.

data : v_amt type i,

v_res type i.

loop at itab.

v_amt = itab-amt * 100.

v_res = v_amt mod 100.

if v_res = 0.

delete itab.

endif.

endloop.

now it will delete all 00 decimals records from itab.

regards

shiba dutta

1 REPLY 1

Former Member
0 Kudos

I dont think you can restrict this condition in select qery. Better you can fetch all the records into an int table and then delete which have 00 decimals.

first select all the data in itab.

data : v_amt type i,

v_res type i.

loop at itab.

v_amt = itab-amt * 100.

v_res = v_amt mod 100.

if v_res = 0.

delete itab.

endif.

endloop.

now it will delete all 00 decimals records from itab.

regards

shiba dutta