You may need to check the servers this runs on for what @@datefirst is otherwise a quick stab at this is:-
IF DATEPART(dw, GETDATE()) = 1-- any time on Sunday
OR ( DATEPART(dw, GETDATE()) = 7
AND DATEPART(hour, GETDATE()) > 5
) -- after 6 a.m. Saturday
OR ( DATEPART(dw, GETDATE()) = 2
AND DATEPART(hour, GETDATE()) < 6
) --before 6 a.m. Monday
BEGIN
PRINT 'Criteria correct'
END
But you need to check this as my server settings are different to yours
-------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx