Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 MS Access 中触发此查询
SELECT file_number, IIF(invoice_type='Spent on Coding',SUM(CINT(invoice_amount)), 0) as CodingExpense FROM invoice GROUP BY file_number
我收到此错误
函数参数列表中的错误:“=”无法识别。无法解析查询文本。
我尝试替换IIF为SWITCH无济于事。 我的查询有什么问题以及如何更正?
IIF
SWITCH
AFAIK,你需要反过来:
Sum(IIF(invoice_type="Spent on Coding",CINT(invoice_amount), 0)) as CodingExpense
但是,我建议:
Round(Sum(IIF(invoice_type="Spent on Coding",invoice_amount, 0)),0) as CodingExpense