declare @ch_time int
declare @c_time char
//从一个表中查询出一个字符型数据赋值给@c_time
@c_time = select ch_time from change_time where ch_id=1
//转换为整型
cast(@c_time as int)
@ch_time=@c_time
下面我想判断 现在时间 - 表中某个时间 是否大于 @ch_time个小时
这些语句怎么写呢?
...全文
1396打赏收藏
SQL SERVER作业中的步骤命令语句
declare @ch_time int declare @c_time char //从一个表中查询出一个字符型数据赋值给@c_time @c_time = select ch_time from change_time where ch_id=1 //转换为整型 cast(@c_time as int) @ch_time=@c_time 下面我想判断 现在时间 - 表中某个时间 是否大于 @ch_time个小时 这些语句怎么写呢?
CREATE PROCEDURE dbo.B_BabyDetails_SelectBabyFromDate
@sDate datetime,@eDate datetime
AS
select * from Bab_Prg_Pat where BAB2003>=@sDate and BAB2003 <= @eDate
GO