CASE
WHEN (tkg.point_trkg_cd not in (23,30) AND iv.devltn_drft_nr is null) THEN
CASE
WHEN (select count(1) from sir_sbmsn_acct b
where iv.cmpgn_nr = b.cmpgn_nr
AND iva.cmpgn_yr = b.cmpgn_yr
AND iva.acct_nr = b.acct_nr
AND iv.ord_id = b.ord_id
AND b.SBMSN_ACCT_TYP in(4,13)) > 0) THEN 'volume não escaneado no transportador'
ELSE
'volume duplicado'
END
ELSE
CASE
WHEN (tkg.point_trkg_cd in (23,30) AND tkg.point_trkg_cd =25) THEN 'volume não recebido no CD (trânsito)'
ELSE
NULL
END
END AS situacao

0

neoarwinAuthor Commented: 2012-03-12

Thank you very much I will try this :)

0

neoarwinAuthor Commented: 2012-03-25

It never worked out by that way, but you did a good try and I appreciate that, thank you very much.