Select Convert(Varchar(7),DateAdd(mm,number,'2014-01-01'),120) As YYMM From master..spt_values Where [type] = 'p' and number Between 0 And DateDiff(mm,'2014-01-01','2014-12-01')
内循环SQL:
复制代码
Select * From KS_Article Where Convert(varchar(7),Adddate,120)='{$Param(0)}' Order By ID Desc