时间的格式问题
从数据库去时间:getdate(),我想使用hh:mm,
现在使用convert(char(10),getdate(),108)得到
9:00:22,
使用
datepart(hour,t.BegPlanTime)+":"+datepart(minute,t.BegPlanTime)+"--"+datepart (hour,t.EndPlanTime)+":"+datepart(minute,t.EndPlanTime)
则提示不可把int 和 varchar想加,
如果使用convert(char(2),datepart(hour,t.BegPlanTime))之后在连接,则把9:00的两个零变成一个零,
请问有没有format()变换的函数直接转换成hh:mm?
问题点数:20、回复次数:1Top
1 楼hobbylu(东方一剑(提供技术咨询服务,请联系QQ31827516))回复于 2004-09-01 11:16:26 得分 20
substring(convert(char(10),getdate(),108),1,5)Top




