请协助以下代码。这是我正在撰写的报告的一部分。该查询使用IF语句并具有嵌套的IF以返回所需的结果。解析查询时出现错误,如下所示,但我似乎无法解决错误。
查询
IF("GLAFS"."FSCSDSG"='A' AND "GLAFS"."FSCSYR">=(CONVERT('@GLYEAR@',SQL_NUMERIC) -4),IF
("GLAFS"."OPENBAL"=0 AND "GLAFS"."NETPERD1"=0 AND "GLAFS"."NETPERD2"=0 AND "GLAFS"."NETPERD3"=0
AND "GLAFS"."NETPERD4"=0 AND "GLAFS"."NETPERD5"=0 AND "GLAFS"."NETPERD6"=0
AND "GLAFS"."NETPERD7"=0 AND "GLAFS"."NETPERD8"=0 AND "GLAFS"."NETPERD9"=0
AND "GLAFS"."NETPERD10"=0 AND "GLAFS"."NETPERD11"=0 AND "GLAFS"."NETPERD12"=0
AND "GLAFS"."NETPERD13"=0,0,1),0)
错误
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '@GLYEAR@'.
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ','.