我正在尝试在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
无效
我的查询有什么问题以及如何解决这个问题?
答案 0 :(得分:1)
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