MS SQL SP Variables

DECLARE @enteredOn  datetime;

— Sun
IF datepart(dw, getdate()) = 1
Set @enteredOn =getdate()-7

(CONVERT(datetime, CONVERT(varchar, SOEB.ASK_salesproccomp, 103), 103)
>= CONVERT(datetime, CONVERT(varchar, @enteredOn, 103), 103))

Software engineers do the job better!