34,576
社区成员
发帖
与我相关
我的任务
分享
select left(fbatchno,6) from icinvinitial
where left(fbatchno,2)='09'
and len(fbatchno)=6
and isdate(left(fbatchno,6))=0 --用0,看有沒有資料
select convert(varchar(10),convert(datetime,'091201'),120)
----------
2009-12-01
select convert(varchar(10),cast('091201' as datetime),120)
select cast('091201' as datetime)
select convert(varchar(10),cast('091201' as datetime),120)
select convert(varchar(10),cast('20'+'091201' as datetime),120)
/**
----------
2009-12-01
(所影响的行数为 1 行)
**/