我正在尝试在 excel 中获取将被视为“嵌套 if”函数的内容以在查询中制定。查询的目标是创建一个视图,以便我可以比较两组数据。
如果在 excel 中,公式如下所示:=IF(condition1=0,condition2,IF(condition2=0,condition3,condition1))。
我不断收到此错误消息:
我尝试使用的查询语言是:
drop view danburycomp
go
create view danburycomp as
SELECT *,
TotalCash=CASE
WHEN [cash out] = 0 THEN [cash counter cash in]
WHEN [cash counter cash in] = 0 THEN [cash counter cash out]
ELSE [cash out]
END
FROM [trans jan-mar2016]
WHERE [account number] IN ( 'UNIQUEID1', 'UNIQUEID2' )
AND ( [cash into trans] != 0
OR [cash out] != 0 )
AND [date time trans] BETWEEN '2016-01-29' AND '2016-02-24'