執行如下sql:sql
select convert(varchar(7),dateadd(month,number,'2016-01-01'),120) report_period from master..spt_values where type='P' and dateadd(month,number,'2016-01-01')<='2017-07-01'
執行如下sql:sql
select convert(varchar(7),dateadd(month,number,'2016-01-01'),120) report_period from master..spt_values where type='P' and dateadd(month,number,'2016-01-01')<='2017-07-01'