在使用case对金额字段进行操作时报错
The maximum possible number of places in the expression starting with DMBTR is 34 places with 2 decimal places. There can be, however, no more than 31 places and 14 decimal places.
select CASE bsad~shkzg WHEN 'H' THEN bsad~dmbtr * -1 ELSE bsad~dmbtr END AS dmbtr, CASE bsad~shkzg WHEN 'H' THEN bsad~dmbe2 * -1 ELSE bsad~dmbe2 END AS dmbe2, from bsad.
需要使用cast进行类型转换
select CASE bsad~shkzg WHEN 'H' THEN ( CAST( bsad~dmbtr * -1 AS CURR( 23,2 ) ) ) ELSE bsad~dmbtr END AS dmbtr, CASE bsad~shkzg WHEN 'H' THEN ( CAST( bsad~dmbe2 * -1 AS CURR( 23,2 ) ) ) ELSE bsad~dmbe2 END AS dmbe2, from bsad.
标签:CASE,dmbe2,语法错误,opensql,WHEN,ABAP,dmbtr,places,bsad From: https://www.cnblogs.com/Lingcc/p/17460112.html