Я бы хотел, чтобы сумма отображалась, если ноль не был показан, этот запрос получен для меня только отдельно
Как мне добавить этот запрос к моему запросу
case when [Summa]=0 then null else round(a.Summa,2) end as Summa
Это запрос, который мне нужен
SELECT
[a].[id],
CONVERT(NVARCHAR(10), [a].[Date], 104) AS [Data],
[j].[Login],
[b].[Name] AS [NameAgency],
[c].[Name] AS [NamePosition],
[d].[Name] AS [NameOperatonsType],
[e].[Name] AS [NamePartnerType],
[f].[Name] AS [NameType],
[g].[Name] AS [NamePartners],
[h].[name] AS [NameBank],
[i].[name] AS [NameCurrency],
CASE
WHEN [d].[ID] = 2 THEN
'0'
ELSE
[a].[Summa]
END AS [Prikhod],
CASE
WHEN [d].[ID] = 1 THEN
'0'
ELSE
[a].[Summa]
END AS [Raskhod],
[a].[Comment]
FROM
[Operations] AS [a] LEFT JOIN
[Agency] AS [b] ON [a].[AgencyID] = [b].[ID] LEFT JOIN
[Position] AS [c] ON [a].[PositionID] = [c].[ID] LEFT JOIN
[OperatonsType] AS [d] ON [a].[OperType] = [d].[ID] LEFT JOIN
[PartnerType] AS [e] ON [a].[ParentID] = [e].[ID] LEFT JOIN
[NameType] AS [f] ON [a].[NameTypeID] = [f].[ID] LEFT JOIN
[Partners] AS [g] ON [a].[PartnerID] = [g].[id] LEFT JOIN
[Bank] AS [h] ON [a].[BankID] = [h].[id] LEFT JOIN
[Currency] AS [i] ON [a].[CurrencyID] = [i].[id] LEFT JOIN
[Users] AS [j] ON [a].[UserID] = [j].[ID]
WHERE
[a].[Date] = CAST(GETDATE() AS DATE)
ORDER BY
[a].[id] DESC;
Я хочу заменить 0 на NULL для столбцов Приход и Расход. Пожалуйста, дайте мне знать, какие изменения необходимо сделать.