Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    JackieFeng is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2016
    Posts
    24

    .I am so confused.. how do i calculate my finishing time then?? i added duration into the booking table. The dateadd function still not working

  2. #17
    JackieFeng is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2016
    Posts
    24
    I added field 'duration' into tblbooking but dateadd function was still not working.....

  3. #18
    orange's Avatar
    orange is online now Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    ??? In the jpg I posted your Duration and FinishingTime from your database, the values are correct.
    In your own words, what is the difference in your tables Booking and Treatment?

    If you have a FinishingTime and a StartTime, you can calculate Duration.

    The question seems more related to where is this info recorded.

    Booking StartTime 10:00 BookingFinishingTime 10:35, so Duration = Finishingtime-StartTime = 35
    Treatment StartTime 10:00, treatment Duration 35 do TreatmentFinishingtime = 10:00 +35 =10:35
    TreatmentEndTime = 10:35, treatment Duration = 35, so treatment StartTime = 10;35 -35 = 10:00

  4. #19
    JackieFeng is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2016
    Posts
    24
    starttime is 12:00, duration of specific treatment is 30mins so i want to calculate finishing time.. using dateadd

    but in the booking form, the finishing time is not calculated....so i just wanna know what my problem was.

  5. #20
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Everything else aside...and the points raised by orange are important...as to why your Default Value syntax isn't working, is that when referencing Controls, in the Properties Pane, as you're doing, here, in the Default Value, the names of the Controls have to be delimited using Square Brackets...not Quotation Marks!

    Instead of

    =DateAdd("n","Duration","StartTime")

    you have to use

    =DateAdd("n",[Duration],[StartTime])

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. DateAdd not working
    By quinnsfpa in forum Forms
    Replies: 6
    Last Post: 11-10-2015, 01:06 AM
  2. used function DateAdd
    By azhar2006 in forum Queries
    Replies: 2
    Last Post: 10-07-2015, 03:31 PM
  3. DateAdd Function?
    By zburns in forum Reports
    Replies: 7
    Last Post: 06-23-2015, 01:55 PM
  4. DateAdd Function
    By jschlapi in forum Forms
    Replies: 4
    Last Post: 10-23-2013, 01:36 PM
  5. DateAdd Function
    By Desstro in forum Programming
    Replies: 3
    Last Post: 04-03-2011, 01:45 PM

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