关于是sql2000中小数点后位数的问题
如何让图中的蓝色区域数字可以正确的显示小数点后四位即可(0.0909)(0.0476)查询语句如下:selectObjid,sptm,casewhenlsj<>0then...
如何让图中的蓝色区域数字可以正确的显示小数点后四位即可(0.0909)(0.0476)
查询语句如下:
select Objid,sptm,case when lsj<>0 then (lsj-jj)/lsj else 0 end as mll,
lsj-jj as mlje into #a from spdw
select Objid,spmc,gysbh,gysmc,splbbh,splbmc into #b from spda
select a.Objid as 商品编号,a.sptm as 商品条码,b.spmc as 商品名称,a.mlje as 毛利金额,a.mll as 毛利率,b.splbbh as 商品类别编号,b.splbmc as 商品类别名称,b.gysbh as 供应商编号,b.gysmc as 供应商名称
from #a a,#b b where a.Objid=b.Objid
drop table #a
drop table #b
希望高人指点,帮忙改正改正。其中spdw中的jj lsj 的数据类型为real 展开
查询语句如下:
select Objid,sptm,case when lsj<>0 then (lsj-jj)/lsj else 0 end as mll,
lsj-jj as mlje into #a from spdw
select Objid,spmc,gysbh,gysmc,splbbh,splbmc into #b from spda
select a.Objid as 商品编号,a.sptm as 商品条码,b.spmc as 商品名称,a.mlje as 毛利金额,a.mll as 毛利率,b.splbbh as 商品类别编号,b.splbmc as 商品类别名称,b.gysbh as 供应商编号,b.gysmc as 供应商名称
from #a a,#b b where a.Objid=b.Objid
drop table #a
drop table #b
希望高人指点,帮忙改正改正。其中spdw中的jj lsj 的数据类型为real 展开
展开全部
select cast( 9.0909094e-2 as decimal(10,4))
select round( 9.0909094e-2,4)
select round( 9.0909094e-2,4)
更多追问追答
追问
先谢谢了
能否结合我的查询语句 对查询后的数据进行整体的修改?
追答
select Objid,sptm,round((case when lsj0 then (lsj-jj)/lsj else 0 end), 4) as mll,
round(lsj-jj,4) as mlje into #a from spdw
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询