救命啊~~~~在SQL里 计算两个时间的间隔 精确到时 分秒 应该怎么写???(50分)

  • 主题发起人 主题发起人 thebly
  • 开始时间 开始时间
T

thebly

Unregistered / Unconfirmed
GUEST, unregistred user!
在SQL里 计算两个时间的间隔 精确到时 分秒 应该怎么写???
 
什么意思 secondesbetween()?
 
select rtrim(cast(cast(datepart(hour,getdate()) as int)-cast(datepart(hour,2006-11-25) as int)as char))+':'+
rtrim(cast(cast(datepart(minute,getdate()) as int)-cast(datepart(minute,2006-11-25) as int)as char))+':'+
ltrim(cast(cast(datepart(second,getdate()) as int)-cast(datepart(second,2006-11-25) as int)as char))
 
可以使用下面的SQL语句,
Select convert(nvarchar(8), Time1- Time2, 114)
注:Time1和Time2是要做差的两个时间值
 
select datediff(ss,'2006-11-30',getdate())
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
I
回复
0
查看
686
import
I
后退
顶部