2011-03-09 173 views

回答

0
DECLARE @d INT = 10, 
     @m INT = 2, 
     @y INT = 2011 

SELECT DATEADD(DAY, @d - 1, 
     DATEADD(MONTH, @m - 1, 
     DATEADD(YEAR, @y - 1, CAST('00010101' AS DATE)))) 
0

如果列類型爲datetime嘗試使用以下命令:

set dateformat dmy 

insert into TABLE_NAME (COL_NAME) VALUES ('10.02.2011')