[求助]在線等急?
請問如何將varchar轉換成int類型
完成下面的結果:
declare @new table
( code char(20),sdate char(20),sumsales money,sumtax money)
insert into @new
select tihinvoicecode,tihmovedate,tihsmhaccount,tihsmhpay from tmpinvoiceheader union all
select tihinvoicecode,tihmovedate,tihsmhaccount,tihsmhpay from tmpinvoiceheader_bad
select a=min(code),b=max(code),c=min(sdate),d=max(sdate),e=sum(sumsales),f=sum(sumtax)
from @new
group by ( cast(code as int)-1)/50
謝謝!!!!