I want to select either week days or a full week depending on a parameter.
I was looking at using a case statement to do the following, but I don't know how to convert a string of number to a value that can be passed as integers.
Im probably doing this all wrong but any help would be appreciated.
This is where im setting the param value:
set @days = (select case when FullWeek = 1 then cast('1,2,3,4,5,6,7' as Numeric(38,0))
when fullweek = 0 then cast('2, 3,4,5,6' as Numeric(38,0)) end
from Reports)
And this is how I want to call this, its part of a where statement:
where datepart(dw,date) in (@days)