SQL Server 中读取当前年月
1、读取当前年月:select convert(char(7),getdate(),112);
2、读取数据库中列的年月: select convert(char(7),[Date]{此为列名},20)
3、读取当前月份的前两个月份:
select convert(char(7),DateAdd ("m" , -2 , getdate()),20)
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22392018/viewspace-1063102/
,如需转载,请注明出处,否则将追究法律责任。