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' )
答案 0 :(得分:1)
MS Access需要带有表的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;