Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
akpaga
Constraint Violating Yak Guru
331 Posts |
Posted - 2012-07-26 : 17:48:47
|
Hi friends,Iw ould liek to create a dynamic column in aquery to hold values of the yearsyears20122013My query should return the above result set...how can i do hat in query... |
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2012-07-26 : 18:00:51
|
just those two years? is that all the column you want<><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2012-07-26 : 18:02:01
|
select year(getdate()) as yearsUNION select year(getdate()) - 1 years<><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
|
|