我正在尋找一些幫助將訪問查詢轉換爲sql服務器。將使用IIF的訪問查詢轉換爲SQL Server
它的大部分我罰款,但我與IIF部分
SELECT *
FROM (([if_submission]
LEFT JOIN [payrollruns]
ON [if_submission].[periodnumber] = [payrollruns].[runid])
LEFT JOIN [if_rti_finalfps_q]
ON [payrollruns].[runid] = [if_rti_finalfps_q].[runid])
LEFT JOIN [if_rti_eps]
ON [if_submission].[submissionid] = [if_rti_eps].[submissionid]
WHERE [if_submission].[taxyear] = 2016
AND (**IIF([if_submission].[submissiontypeid] = 8,
[payrollruns].[payemonth] = 5,
[if_submission].[periodnumber] = 5)**)
AND ([if_submission].[submissiontypeid] = 8
OR [if_submission].[submissiontypeid] = 10)
AND [if_submission].[testinlive] = 0
ORDER BY submissiontypeid
這是位我需要
IIF([if_submission].[submissiontypeid] = 8,
[payrollruns].[payemonth] = 5,
[if_submission].[periodnumber] = 5)
任何人的幫助有任何想法掙扎?
感謝
你確定在MS Access工作?這看起來像使用'iif'的一種非常奇怪的方式。 – sstan
是的,肯定適用於Access – user6753539