Microsoft Accessにスケジュールデータベースがあります。私はそれに私の命令を持っているテーブルを持っていると私は,IIf([engraving]>0,Date()+18,IIf([plating]>0,Date()+17
を使用している2つのクエリの間に30列と私は..... .....SQLでif文を使用する方法
私は2つの異なるクエリを結合する必要があり、私はすべてのユニオンを使用していない場合でも重複を取得しているので、SQLでこれを行う簡単な方法があるのだろうかと思います。要求された以上のものとして を追加しました:
SELECT IIf([BLAST]>0,Date()+18,IIf([Strip Cu-Ni]>0,Date()+18,IIf([Strip Hard Face]>0,Date()+17,IIf([Repair Determination]>0,Date()+16,IIf([Machine For Patch]>0,Date()+16,IIf([Fit Up]>0,Date()+15,IIf([EB Weld]>0,Date()+15,IIf([Bader]>0,Date()+14,IIf([Local Straightening]>0,Date()+13,IIf([Hot Die]>0,Date()+12,IIf([Vapor Hone]>0,Date()+11))))))))))) AS [Estimated Ship Date], [Front End Classic].[CUSTOMER NAME], [Front End Classic].Priority, [Front End Classic].FAMILY, [Front End Classic].[PO#], [Front End Classic].[DATE RECEIVED], [Front End Classic].Priority, [Front End Classic].qty, [Front End Classic].Blast, [Front End Classic].[Strip Cu-Ni], [Front End Classic].[Strip Hard Face], [Front End Classic].CMM, [Front End Classic].[Repair Determination], [Front End Classic].UT, [Front End Classic].[Machine For Patch], [Front End Classic].[Fit Up], [Front End Classic].[EB Weld], [Front End Classic].Bader, [Front End Classic].[Local Straightening], [Front End Classic].[Hot Die], [Front End Classic].[Vapor Hone], [Front End Classic].[Prep Shroud], [Front End Classic].[Weld Shroud], [Front End Classic].[Prep Tip], [Front End Classic].[Weld Tip], [Front End Classic].[Mill Tip], [Front End Classic].[Mill Shroud], [Front End Classic].Blend, [Front End Classic].[Stress Relief], [Front End Classic].FPI, [Front End Classic].[X-Ray], [Front End Classic].PEEN, [Front End Classic].ECI, [Front End Classic].HVOF, [Front End Classic].Vibro, [Front End Classic].[CU-NI], [Front End Classic].Seals, [Front End Classic].[Moly Dag]
FROM [Front End Classic]
WHERE (((IIf([BLAST]>0,Date()+18,IIf([Strip Cu-Ni]>0,Date()+18,IIf([Strip Hard Face]>0,Date()+17,IIf([Repair Determination]>0,Date()+16,IIf([Machine For Patch]>0,Date()+16,IIf([Fit Up]>0,Date()+15,IIf([EB Weld]>0,Date()+15,IIf([Bader]>0,Date()+14,IIf([Local Straightening]>0,Date()+13,IIf([Hot Die]>0,Date()+12,IIf([Vapor Hone]>0,Date()+11)))))))))))) Is Not Null));
私は、iif関数よりも簡単なケース構成を考えています。 –
スニペット行ではなく、より多くのクエリを投稿してください。そしてあなたは*簡単な方法*を意味しますか?あなたは望む結果を受け取っていますが、あまりにも多くのネストされた 'IIF()'を望ましくありませんか? – Parfait
私は必要な結果を得ていますが、入れ子にされたif文が多すぎますので、2つのクエリに分割してユニオンを使用しなければなりません。 – GianniR