【发布时间】:2018-04-11 23:39:20
【问题描述】:
我的推荐人是How to replace blank (null ) values with 0 for all records?
目标:我有空白查询输出。 Image0 我希望打印出 0。
问题:当我尝试IIF Isnull时,我得到一个提示消息框输入参数值,我不想看到。 Image1
PARAMETERS [BeginDate] DateTime, [EndDate] DateTime;
SELECT Sum(dbo_SO_SalesHistory.DollarsSold) AS SumOfDollarsSold, IIF(ISNULL([SumOfDollarsSold]), 0, [SumOfDollarsSold])
FROM dbo_SO_SalesHistory
WHERE (((dbo_SO_SalesHistory.InvoiceDate) Between [BeginDate] And [EndDate]) AND ((dbo_SO_SalesHistory.CustomerNo)="M"));
这是我运行 SQL 后的查询:Image2
然后我尝试了UPDATE
PARAMETERS [BeginDate] DateTime, [EndDate] DateTime;
SELECT Sum(dbo_SO_SalesHistory.DollarsSold) AS SumOfDollarsSold
UPDATE [dbo_SO_SalesHistory.DollarsSold] SET [SumOfDollarsSold] = 0
FROM dbo_SO_SalesHistory
WHERE (((dbo_SO_SalesHistory.InvoiceDate) Between [BeginDate] And [EndDate]) AND ((dbo_SO_SalesHistory.CustomerNo)="M")) AND [SumOfDollarsSold] IS NULL;
它给了我The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect. 错误消息:Image3
对于我使用的任何方法的任何建议都将不胜感激。谢谢!
【问题讨论】:
标签: sql ms-access null ms-access-2010 ms-access-2007