Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224

    Unanswered: update a table using execute

    I have 2 tables BOOKS and CHECKOUTS
    When i click the return button, it changes the status in BOOKS to in library
    and sets the endate in CHECKOUTS to enddate where enddate is null and bookid is the same

    dbCW.Execute ("UPDATE books set [status]='IN LIBRARY' where [bookid]='" & Me.BookID & "'")
    dbCW.Execute ("UPDATE checkouts set enddate = date() where [enddate]=null and [bookid]='" & Me.BookID & "'")

    The second statement doesnt work. What I need to do is set the date that the book was returned to the present date


    Any help well be greatly appreciated

  2. #2
    Join Date
    Dec 2001
    Posts
    79
    Try this:

    dbCW.Execute ("UPDATE checkouts set enddate = #" & date() & "# where [enddate]=null and [bookid]='" & Me.BookID & "'")

    Hope this helps,
    Peter De Baets
    Peter's Software - Microsoft Access Tools for Developers
    http://www.peterssoftware.com

  3. #3
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224
    no that doesnt work
    it doesnt seem to set the enddate field in checkouts table

  4. #4
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224
    I think the logic is correct but the syntax perhaps is not

    could some one help me with this

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •