SQL required for delete

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neil

    #1

    SQL required for delete

    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(dateboo ked)))="Thursda y" then delete record etc)

    I am using ASP VBscript


    Thanks for any help.
    Neil


  • pietlinden@hotmail.com

    #2
    Re: SQL required for delete

    DELETE
    FROM bookings
    WHERE ((Room='B4'
    AND Lesson=4
    AND (Weekday([somedate]))=5));

    Comment

    • Neil

      #3
      Re: SQL required for delete

      Thanks for that pietlinden!

      <pietlinden@hot mail.com> wrote in message
      news:1121368864 .626646.304060@ g14g2000cwa.goo glegroups.com.. .[color=blue]
      > DELETE
      > FROM bookings
      > WHERE ((Room='B4'
      > AND Lesson=4
      > AND (Weekday([somedate]))=5));
      >[/color]


      Comment

      Working...