IanWaterman
Programmer
This is my failed attempt at a Where clause
where (case when @SelectGL = 'Client Account' then TXN_GLCODE_FK = 211 else TXN_GLCODE_FK in (353, 355) end)
and TXN_AMOUNT <> 0
and cast(TXN_CREATED_DATE as date) >= @StartDate
and cast(TXN_CREATED_DATE as date) <= @Enddate
I know the use of case is wrong. I am trying to to build logic that when
@SelectGL = 'Client Account' then TXN_GLCODE_FK = 211
or
@SelectGL = 'Interest' then TXN_GLCODE_FK in (353, 355)
Any suggestions
Thank you
Ian
where (case when @SelectGL = 'Client Account' then TXN_GLCODE_FK = 211 else TXN_GLCODE_FK in (353, 355) end)
and TXN_AMOUNT <> 0
and cast(TXN_CREATED_DATE as date) >= @StartDate
and cast(TXN_CREATED_DATE as date) <= @Enddate
I know the use of case is wrong. I am trying to to build logic that when
@SelectGL = 'Client Account' then TXN_GLCODE_FK = 211
or
@SelectGL = 'Interest' then TXN_GLCODE_FK in (353, 355)
Any suggestions
Thank you
Ian