Results 1 to 6 of 6
  1. #1
    Siobhan is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    4

    Question Update Query Help Needed

    Please can any of you help me?

    My database is for a local garage and I have a booking table.
    My booking table has the following fields;
    Booking ID
    Customer ID
    Service Items ID
    Booking Date - Long date format
    Booking Time


    Booking Duration
    Total Booking Cost
    Payment Due By

    I am trying to create an update query which will update the "Payment Due By" from adding 7 days to the "Booking Date" however, when I try to update by doing [Booking Date] +7 nothing happens?

    Please can you help me to complete this update query

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It would help to see the SQL of your query, but if due date is always 7 days after the booking date, I wouldn't bother saving it and trying to keep it updated. You can calculate it on the fly.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Siobhan is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    4
    This is what I have tried to do UPDATE tblBooking SET tblBooking.[Payment Due By] = [tblBooking]![Booking Date]=DateAdd("d",7,[tblBooking]![Booking Date]);

    I have to show as screenshots that the query works as I have a dual purpose for it, its for the garage and part of my A Level Exam.
    Thanks for your help

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Oh, and personally I'd store the booking date and time in one field. It's easy enough to break them apart for display to the user. You'll likely have to join them together for queries anyway.

    And hopefully you don't have those spaces in the field names. They aren't worth the bother in the long run.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    With the two "=" in your SQL, you're setting the field to a True/False value based on the evaluation of the second one. You'd want:

    UPDATE tblBooking SET [Payment Due By] = DateAdd("d",7,[Booking Date])

    But again, storing what is essentially a calculated field violates the Normalization rules that I assume the professor discussed.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Siobhan is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    4
    Thank you very much! It finally works

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query help needed on a one to many sum
    By devphreak in forum Queries
    Replies: 3
    Last Post: 02-25-2011, 10:49 AM
  2. Help needed with Query...
    By showmak in forum Queries
    Replies: 4
    Last Post: 09-10-2010, 07:23 PM
  3. Use Table1 to update Table2? Urg Help needed
    By munkifisht in forum Queries
    Replies: 1
    Last Post: 07-24-2009, 08:00 AM
  4. Query help needed asap!!
    By msaccess09 in forum Queries
    Replies: 1
    Last Post: 02-25-2009, 09:39 PM
  5. Noob Query Help Needed
    By fenster89411 in forum Queries
    Replies: 0
    Last Post: 01-11-2009, 09:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums