注册 登录
编程论坛 SQL Server论坛

日期函数问题

心动音符 发布于 2006-10-15 20:12, 418 次点击

select year(1999),month(12),day(19)
为什么输出的是
1905 1 20
而不是
1999 12 19

1 回复
#2
LouisXIV2006-10-15 21:54

1.自行补习year,month,day函数的用法

2.执行一下下面的语句, 希望你能明白为什么出现这样的情况

declare @a datetime
declare @b datetime
declare @c datetime
select @a=1999
select @b=12
select @c=19
select @a,@b,@c

1