wcc799
wcc799
2017-09-23 14:33

【在将 varchar 值 '@s_shopid@ int' 转换成数据类型 int 时失败。】

  • 存储过程
  • 数据
  • select

/****** Object: StoredProcedure [dbo].[pos_billfood_hz] Script Date: 09/23/2017 20:34:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
alter procedure [dbo].[pos_billfood_hzqx]
@FDate@ datetime,
@Edate@ datetime,
@s_shopid@ int,
@s_foodname@ varchar (355)
as

--pos_billfood_hzqx '2017-06-21','2017-08-21','104492',''

---汇总取消
select a.FOODID as 食品编码 ,a.FOODNAME as 食品名称,sum(a.QTY) as 取消数量,sum(a.AMT) as 取消金额,
convert(nvarchar(10),a.ordertime,120) as 营业日期 ,c.FNAME as 业务组织
from pos_billfood a
inner join POS_BILL b on a.BILLID=b.BILLID and a.FSHOPID=b.FSHOPID
inner join T_ORG_ORGANIZATIONS_L c on a.fshopid=c.FORGID
where convert(nvarchar(10),a.ordertime,120) >= '@FDate@' and convert(nvarchar(10),a.ordertime,120) < '@Edate@'
and a.FSHOPID='@s_shopid@ int' and a.ISATTACHMEAL='1'
group by a.fshopid ,a.FOODID,a.FOODNAME,convert(nvarchar(10),a.ordertime,120),c.FNAME

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答