Ich habe SQL Server Fall Ausdruck, der nicht zu funktionieren scheint, wenn es um diese Linie bekommt:SQL Server Fall Expression nicht mit dem zweiten Zustand arbeitet
WHEN cl.Product_Type = 'PerformanceSwap' and
cl.Underlying_Product_Code_IndexType IS NULL THEN
Der vollständige Code-Block ist:
CASE
WHEN prod_map.Product_ID1 = 'CR' AND prod_map.Product_Type <>
'PerformanceSwap' THEN
--(mandatory for transactions where asset_class = CR)
CASE
WHEN cl.AB_Payment_Frequency = 'Monthly' THEN 'MNTH'
WHEN cl.AB_Payment_Frequency = 'Quarterly' THEN 'QURT'
WHEN cl.AB_Payment_Frequency = 'Yearly' THEN 'YEAR'
WHEN cl.Product_Type = 'PerformanceSwap' and
cl.Underlying_Product_Code_IndexType IS NULL THEN
CASE
WHEN cl.AB_Finance_Payment_Frequency = 'MNTH' THEN 'MNTH'
WHEN cl.AB_Finance_Payment_Frequency = 'SW' THEN 'MIAN'
WHEN cl.AB_Finance_Payment_Frequency = 'QTR' THEN 'QURT'
WHEN cl.AB_Finance_Payment_Frequency = 'PA' THEN 'YEAR'
WHEN cl.AB_Finance_Payment_Frequency = 'ZC' THEN 'YEAR'
ELSE ''
END
END
END,
Muss ich einen anderen Case-Ausdruck in diesem tun? oder etwas anderes, so dass es die AB_Finance_Payment_Frequency-Werte erhöhen kann.
Welche Ergebnisse versuchen Sie zu erzielen? –
Der erste WHEN stellt sicher, dass sich prod_map.Product_Type von "PerformanceSwap" unterscheidet. Also, wenn Sie das WANN sagen, hat Probleme, sind Sie sicher, dass Cl.Product_Type den Wert "PerformanceSwap" halten kann? – GuidoG