Schönen guten Tag,

ich hätte da eine Sorge bei der Ihr mir vielleicht helfen könnt.
Da unsere User die Eingaben nicht gewissenhaft auf die Kette bekommen würde ich gerne
ein Eingabefeld regelmäßig per SQL korrigieren.:

Code:
select 
case
when b.tme in ('St','ST') and a.vvolpe != round(decimal((a.vmasl*(a.vmasb/100)*(a.vmass/1000)), 15, 6), 6) then round(decimal((a.vmasl*(a.vmasb/100)*(a.vmass/1000)), 15, 6), 6) 
when b.tme='m' and (a.vvolpe != round(decimal(((a.vmasb/100)*(a.vmass/1000)), 15, 6), 6) and a.vmasb!='0' and a.vmass!='0') then round(decimal(((a.vmasb/100)*(a.vmass/1000)), 15, 6), 6)
when b.tme='m2' and a.vmass!='0' and a.vvolpe != round(decimal((a.vmass/1000), 15, 6), 6) then round(decimal((a.vmass/1000), 15, 6), 6)
when b.tme='m3' and a.vvolpe != '1.000000' then '1.000000' end Berechnung -- zu änderndes Feld
from kd.yarv a
join kd.yar b on b.artn=a.vartn
where (a.arvlv='' and a.arvsv='') and (b.arlv='' and b.arsv='')
and b.tarst1 in ('1','2', '3','4','5','6','7','8','9','H')
and a.vartnv not in ('FIX', 'ZUS')
and b.tat1 not like ('%Rohfix%') and tat2 not like ('%Rohfix%') 
and (b.tat2 not like ('%sonst%') and b.tat1 not like ('%sonst%'))
and(
(b.tme in ('St','ST') and a.vvolpe != round(decimal((a.vmasl*(a.vmasb/100)*(a.vmass/1000)), 15, 6),6) and (a.vmasl!='0' and a.vmasb!='0' and a.vmass!='0') ) or
(b.tme='m' and (vvolpe != round(decimal(((a.vmasb/100)*(a.vmass/1000)), 15, 6), 6) and a.vmasb!='0' and a.vmass!='0')) or
(b.tme='m2' and a.vvolpe != round(decimal((a.vmass/1000), 15, 6), 6) and a.vmass!='0' ) or
(b.tme='m3' and vvolpe != '1')
)
In diesem Fall geht es um das Volumen im Artikelstamm welches entsprechend berechnet werden und im Fall der Abweichung ersetzt werden soll.
Leider bekomm ich immer die Meldung: "Unterabfrage ergab mehr als eine Zeile..."

Mein herzlichen Dank im voraus.