I have the following WHERE
where I have to put a clause CASE
to do a search depending on the name of the day and it gives me an error in =
that is within THEN
:
Declare @dia date = DATENAME(dw,GETDATE())--aqui obtengo el nombre del dia
Select @Var = COUNT (tc.fecha)
FROM tcambio tc
INNER JOIN tmoneda tm
ON tc.cod_moneda = tm.cod_moneda
WHERE @dia = CASE WHEN @dia = 'Viernes' THEN tc.Fecha = convert(datetime,(GETDATE()+3))