首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

怎么取出日期中时间的这个数字

2012-09-04 
如何取出日期中时间的这个数字在函数中定义create function slot (@intime datetime ,@outtime datetime,@

如何取出日期中时间的这个数字
在函数中定义
create function slot (@intime datetime ,@outtime datetime,@slot char(100),@maxslot varchar(100))
returns decimal(20,1)
现在我想把 @intime 假设为‘2012-8-8 20:12’想把这个里面的小时数20取出来,并在下面的代码中使用,
这个是随机出现的时间,只能用字段来体现除了

[解决办法]
用HOUR(@intim)不行?

热点排行