0
Access查詢:Access查詢和SQL查詢結果不匹配
IIf([rptd mean net (g)] > 0, [rptd mean net (g)] - ([Actual Tare Wt (g)] - [Machine Tare Wt (g)]), [Mean Gross (g)] - [actual tare wt (g)]) AS [Net Mean Wt (g)]
下面是結果我從訪問獲得click me
SQL查詢:
SELECT
CASE
WHEN [Net Weight Tracking].[Rptd Mean Net (g)] > 0
THEN (([Net Weight Tracking].[Rptd Mean Net (g)]) - ([Net Weight Tracking].[Actual Tare Wt (g)])- ([Net Weight Tracking].[Machine Tare Wt (g)]))
ELSE ([Net Weight Tracking].[Mean Gross (g)]) - ([Net Weight Tracking].[Actual Tare Wt (g)])
END AS [Net Mean Wt (g)]
FROM
dbo.[Net Weight Tracking]
下面是結果我正在尋找SQL click me
我的問題是:什麼導致t他在[Net Mean Wt(g)]中的差異,是否對我的SQL case語句有問題,如果有的話,我該如何解決我的查詢問題?
那麼哪一個是準確的? – HackMaster 2015-01-09 20:21:29
這取決於你在找什麼結果。我猜測這個SQL是正確的。 – 2015-01-09 20:31:02
欣賞它... – HackMaster 2015-01-09 20:36:41