时间格式转化问题


declare @ActStartDate datetime

set @ActStartDate ='2012-01-01'
 --select @ActStartDate=FStartDate from t_AccountInfo Where FID=1

print @ActStartDate
print cast(@ActStartDate as varchar(10))
print convert(varchar,@ActStartDate,101)

 

当时间格式用作比较参数的时候,通用做法 应该是 先做格式化转化,用CAST方法不合适

posted on 2012-02-14 14:50  西湖浪子  阅读(117)  评论(0)    收藏  举报