使用 null MS Access 进行计算
我的表名称是 MS ACess 中的 CAPCON 字段ae ID,Transaction, AMount,
我的查询是
Select distinct( CapCon.ID),
(Select sum(amount) from CapCon as c
where c.id=CapCon.id
and transaction='Deposite') -
(Select sum(amount) from CapCon as c
where c.id=CapCon.id and transaction='Withdrawal')
as [Capital Contribution] from CapCOn
如果没有提现交易,则对应ID的【出资】中没有输出
My Table name is CAPCON in MS ACess
Fields ae ID,Transaction, AMount,
My query is
Select distinct( CapCon.ID),
(Select sum(amount) from CapCon as c
where c.id=CapCon.id
and transaction='Deposite') -
(Select sum(amount) from CapCon as c
where c.id=CapCon.id and transaction='Withdrawal')
as [Capital Contribution] from CapCOn
IF the there is no withdrawal transaction, there is no output in [Capital Contribution] for the corresponding ID
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要检查 where 子句中是否为 null:
You need to check for null in your where clause: