I can't get this to work but I think I am close. I need everything that happened on Saturday and Sunday plus anything that happened before work hours and after work hours M-F
Thanks for your help
select *
from so_hdr
where DATEPART(dw,ADDED_DTE) in (1,7) or
(DATEPART(dw,ADDED_DTE) in (2,3,4,5,6) and (DATEPART(HH,ADDED_DTE)<cast('07:30' as datetime) or DATEPART(HH,ADDED_DTE)>cast('16:00' as datetime)))
select * /* <--- good practice is specifying each field instead of * */
from so_hdr
where datepart(day,added_dte) in (1,7)
or datepart(hour,added_dte)*100+datepart(minute,added_dte) not between 730 and 1600