Hello,
Try this :
SELECT datefield FROM table WHERE DATE_FORMAT(datefield, '%W') NOT IN ('Saturday', 'Sunday');
For more info on date functions, please refer to the
mysql manual.
Concerning loops, you can't do that in SQL, so I think you will have to do that in an external program (C++, Java, Php... depending on your needs).
Regards,
RBARAER