我正在从VB.NET应用程序启动一个查询(Access 2003)。
select id, customer, date, total, iif ([amountGet] - [amountSent] = [total], 'Yes', 'No') as result from invoices
但是iif返回错误的结果。
表
id: 1
顾客:佩佩
日期: 01/01/2014
共计:1 8
amountGet: 5
amountSent: 3,2
结果:
返回“否”
什么时候应该返回“是”,因为5-3,2=1,8
发布于 2014-04-04 18:07:56
将数字四舍五入到相同数量的小数,在我的例子中是2小数,返回正确的结果:
iif ( round([amountGet] - [amountSent],2) = round([total],2) )
@jpw感谢您的评论,因为它帮助我找到了解决方案
https://stackoverflow.com/questions/22809899
复制相似问题