在SQL Server 2005 datetime 使用getdate()时默认日期格式是显示 年月日 时分秒 毫秒,如果读取数据时只想使用年月日是可以截取的。
用convert这个函数,select convert(varchar(10),getdate(),120),
结果为:2010-05-13。
在SQL Server 2005 datetime 使用getdate()时默认日期格式是显示 年月日 时分秒 毫秒,如果读取数据时只想使用年月日是可以截取的。