Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Weekend Days In A Date Range

Status
Not open for further replies.

Scooby62

MIS
Jul 10, 2002
97
CA
Does anyone know how to find weekend days in a date range. These would be Saturdays and Sundays.

I have a date range of July 29/04 to July 29/05 in which I want to deleted data entry for any Saturday or Sunday.

If anyone can help I would be ver greatful.

Thanks so much.
 
SET DATEFIRST 1 -- sets first day of week to be monday
DELETE from mytable
WHERE DATEPART(dw,mydatefield ) IN (6,7)

test this as a select first to make sure !!!

DBomrrsm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top