Hi guys,
I need to get the "half" of the year.
I am using the following...
Case
When
CAST(DATEPART(quarter, Stock.VALUEDATE)asint)= 1 then'1'When
CAST(DATEPART(quarter, Stock.VALUEDATE)asint)= 2 then'1'When
CAST(DATEPART(quarter, Stock.VALUEDATE)asint)= 3 then'2'When
CAST(DATEPART(quarter, Stock.VALUEDATE)asint)= 4 then'2'Else
'UnKnown'End
AS'Half',
Is there any more elegant solution? something like
DATEPART
(half,Stock.ValueDate)AS'Month'
Thanks.