By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,160 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

SQL required for delete

P: n/a
Hello

I have an access database table which contains the fields 'room',
'datebooked' and 'lesson' amongst others.

I want to be able to do the following delete, for example :

Delete all bookings in room B4 on every Thursday lesson 4.

Can this be done in a single SQL statement or will I have to create a
recordset containing all the bookings in room B4, lesson 4 and then check
each record one by one to see if it is a Thursday? (ie using
if(weekdayname(weekday(datebooked)))="Thursday" then delete record etc)

I am using ASP VBscript
Thanks for any help.
Neil
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
DELETE
FROM bookings
WHERE ((Room='B4'
AND Lesson=4
AND (Weekday([somedate]))=5));

Nov 13 '05 #2

P: n/a
Thanks for that pietlinden!

<pi********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
DELETE
FROM bookings
WHERE ((Room='B4'
AND Lesson=4
AND (Weekday([somedate]))=5));

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.