2010-07-27 11:29:13.013->100727112913.013
2009-05-25 10:58:23.012->90525105823.012
像这样如何转换啊。。。。
MSSQL是啥? Microsoft SQL Server吗?
select DATEDIFF(nanosecond,'1970-01-01 00:00:00.000','2010-07-27 11:29:13.013');
SELECT REPLACE( REPLACE(REPLACE( SUBSTRING(convert( VARCHAR(23), '2010-07-27 11:29:13.013',121),3,22),'-','') ,':','') ,' ','') ;
SELECT REPLACE( REPLACE(REPLACE( SUBSTRING(convert( VARCHAR(23), GETDATE(),121),3,22),'-','') ,':','') ,' ','') ;
select stuff(REPLACE(REPLACE(REPLACE(CONVERT(varchar(100), GETDATE(), 121),'-',''),' ',''),':',''),1,2,'')
谢谢大佬,不过貌似我这样写也行