我有下面的查询。我正在尝试离开加入另一张桌子。我知道查询应该返回值但值返回为空的事实。有没有人看到我做错了什么?我的大脑在这一点上被炸了。
SELECT
ss.NDC,
ss.ShipToAddressNo,
ss.QuantityShipped,
c.AccrualType,
ss.ExtendedPrice ExtendedPrice,
c.AccrualAmount CBAccrualAmount
FROM
SalesSummary ss left join ChargebackAccruals c on
ss.ClassOfTrade = c.TradeClass and
c.AddressNo is null and
c.ShipTo is null and
c.ShortItemNo is null and
c.LotNumber is null and
ss.InvoiceDate = @RunDate and
ss.InvoiceDate between AccrualBeginDate and AccrualEndDate