私は良いの参照がHow to replace blank (null) values with 0 for all records?SQL IIF ISNULLと更新セット= 0
目標です:私は空白のクエリ出力を持っています。 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を実行した後に見えるです:Image3
何かアドバイスについて:Image2
は、その後、私はそれは私にThe SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
エラーメッセージを表示します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;
を試してみました私が使用した方法のいずれかが高く評価されるだろう。ありがとうございました!実行時に
ありがとうございます!それは多くの意味があります!あなたの答えを54秒で受け入れます。 –