2 zzwzzw946543263 zzwzzw946543263 于 2015.06.01 12:28 提问

sql存储过程使用中时间的输入,求解啊

图片说明
存储过程是这个:
create procedure shoufeiheji
(
@mid varchar(50),
@sjtime1 smalldatetime,
@sjtime2 smalldatetime
)
as
begin
select SUM(cost) from sjhistory where sjtime between @sjtime1 and @sjtime2 and mid =@mid
end
然后得不出我想要的结果0.0

2个回答

danielinbiti
danielinbiti   Ds   Rxr 2015.06.01 13:23
 create proc [dbo].[testTimeProc]
@timepro varchar(20)
as
begin
     print(@timepro);
end

exec testTimeProc '2015-03-01 12:12:14'
edouardzyc
edouardzyc   2015.06.01 13:40

CAST('2015-05-31 13:14:00' as datetime)

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!