Hi
I'm trying to set a column name as the variable below
Declare....
Set @Month1s = cast(dateadd(month, -18, dateadd(day, 1 - day(getdate()), getdate())) as date)
SET @test-2 = (RIGHT(CONVERT(VARCHAR(8), @Month1s, 3), 5))
select....
, case when
(Admission Date]<= @Month1e and [Discharge Date] >= @Month1s) or
([Discharge Date] is null and [Admission Date] <= @Month1e)
then 1 else 0 end as Month1
So what I would like is instead of the output saying Month1 as the column name , I would like the column name to be the value in @test-2 so in this case 12/15
Possible??
Thanks
I