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

    Unanswered: dbcw.execute issue

    I have 2 tables, Books and Checkouts
    Books has name, id and status
    Checkouts has id, startdate and returndate
    If the return date of the book is lesser than date(), it should change the status to overdue. The following code is what I have but it doesnt work because I dont know how to get the returndate from my Checkouts table
    Could someone help

    dbCW.Execute ("UPDATE Books set [status]= 'OVERDUE' where [returndate] <#" & Date & "#")

  2. #2
    Join Date
    Jun 2004
    Posts
    92
    I created a query and used this code for an update query. Worked perfectly.
    It assumes that the ID in both tables is the same.

    UPDATE checkouts INNER JOIN books ON checkouts.id = books.id SET books.status = "overdue"
    WHERE (((checkouts.returndate)>Date()));

  3. #3
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi fullymooned,

    I created a small sample that I think does what you're asking for. If not let me know and will go from there. Just open the form, place a Date in the DateDue box, then go ahead enter a Book Title, CheckedOut date. Then as soon as you enter the returned date, if it is Past the due date.....you'll see.

    trying to help,
    have a nice one,
    Bud
    Attached Files Attached Files

  4. #4
    Join Date
    Jun 2004
    Posts
    92
    I don't think that was what he was looking for. Particularly because he submitted his question with an update query. That to me means he wants to change the data in the table, not pop up some message when you change a date.

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Unhappy

    Hi sionus,

    You are so right, I kinda overlooked that part. That happens when trying to help out and working hard at the same time. Glad you were able to help him out. And thanks for pointing that out to me. Just need to slow the eyes down a bit

    have a nice one,
    Bud

Posting Permissions

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