sql server 获取月份天数:1,SELECT 32-DAY(CAST('2015-03-01' as datetime)+32-DAY(CAST('2015-03-01' as datetime))) 2,SELECT 32-DAY(getdate()+32-DAY(getdate())) 3,select convert(char(10),dateadd(d,-1,dateadd(m,1,CAST('2015-02-01' as datetime))),120):2015-02-28
mysql数据库获取年龄:TIMESTAMPDIFF(YEAR, [出生日期字段], CURDATE()) select * from (select name 姓名,TIMESTAMPDIFF(YEAR, [出生日期字段], CURDATE()) 年龄 from [表名] )a; sqlserver数据库获取年龄:DATEDIFF(yy,[出生日期字段],GETDATE()) select id AS 编号,SStudentName AS 姓名,DATEDIFF(yy,[出生日期字段],G