請問各位大大幫我解決一下我的困惑!
把圖裡折舊攤銷的值(2615.427256)同時輸入到第一行2848.8842562的旁邊
下面是我查詢的程式碼,請各位大大幫幫我了!
select sum(AmtOrg)/3/1000 as 用人費
from PRODDB2.[GGL].[dbo].[VchrDMonthSum]
where orgCompany='JU' AND (Bid=100 or Bid = 110 or Bid = 120 or Bid = 130
or Bid = 140 or Bid = 150 or Bid = 160 or Bid = 170)
and year=2020
and month<=3
select sum(AmtOrg)/3/1000 as 折舊攤銷費用
FROM PRODDB2.[GGL].[dbo].[VchrDMonthSum]
where orgCompany='JU' AND (Bid=620 or Bid = 640 or Bid = 900 or Bid = 910
or Bid = 920 or Bid = 930 or Bid = 940 or Bid = 950)
and year=2020
and month<=3
CREATE TABLE VchrDMonSum(year int,month int,orgCompany nvarchar(10),Bid int,AmtOrg int);
CREATE TABLE Fee0051Cost(FinalOrd float);
insert Fee0051Cost(FinalOrd)
select sum(AmtOrg)/3/1000.0
from VchrDMonSum
where orgCompany='JU'
and year=2020
and month<=3
and (Bid=100 or Bid=110 or Bid=120 or Bid=130)
--
union all
select sum(AmtOrg)/3/1000.0
from VchrDMonSum
where orgCompany='JU'
and year=2020
and month<=3
and (Bid=620 or Bid=640 or Bid=900 or Bid=910 or Bid=920)