2016-10-05 6 views
0
select ((select SUM (Total) 
      from Shirt_Mes 
      where CustomerId =2 
      and Created_Date ='2016-10-05 05:25:06.000') 
     + (select SUM (Total) 
      from Pant_Mes 
      where CustomerId =2 
      and Created_Date ='2016-10-05 05:25:06.000') 
+1

あなたはクエリデザイナーでそれを書いています..? – stuartd

答えて

1

MSアクセスにはテーブル付きのFROM句が必要です。だから、両方ともFROM句に移動しましょう。他にもいくつかの変更があります:

select s.sums + p.sump 
from (select SUM(Total) as sums 
     from Shirt_Mes 
     where CustomerId = 2 and 
      Created_Date = #10/5/2016# -- different date format 
    ) as s, -- Oh, it hurts that MS Access does not have `cross join` 
    (select SUM(Total) as sump 
     from Pant_Mes 
     where CustomerId = 2 and 
      Created_Date = #10/5/2016# 
    ) as p; 
関連する問題