日期:2014-05-18  浏览次数:20531 次

查询过程中,如何将当前年月设置为列的标题
我想设置查询语句,将当前月份设置为列的标题,如
select A.date as '当前年月'from A

因为当前年月是随时间变换的,可以随着显示2011.7,2011.8,2011.9....

应该怎么设置呢

------解决方案--------------------
探讨
SQL code


exec('select A.date as ['+convert(varchar(6),getdate(),120)+'] from A')