none
How do I add minutes to a time?

    Question

  • I've seen some other post, but nothing seemed to work. I have a start time, Task_Start, as Date/Time field and a duration, Task_Dur, as an integer. I want to add a Task_Dur, entered in the system as 15, as in minutes, to the Task_Start, entered as 4:00 pm. The result would be 4:15 pm. I've added dates before, like days and weeks, but never time, and everything errors out. but no luck, the numbers don't add

    First I tried Task_End = Task_Start + Task_Dur, then realized DateAdd, so I tried Task_End =Format(DateAdd("n",DATEPART("n",Task_Dur),Task_Start), "hh:mm am/pm") but no luck, the numbers don't add. What am I doing wrong

    Thanks


    Chris Freeman IT Project Mgr.

    Monday, September 09, 2013 6:32 AM

Answers

  • Use the DateAdd function to add minutes. Like:

    Task_End = DateAdd("n", Task_Dur, Task_Start)


    Groeten, Peter http://access.xps350.com/

    • Marked as answer by cfreema7 Monday, September 09, 2013 10:30 PM
    Monday, September 09, 2013 7:44 AM
  • 1.  Just use

    DateAdd("n",Task_Dur,Task_Start)

    to add [Task_Dur] (15) minutes to the start time.

    2.  If it is shown in a Control on the Form, you should use the Form Property of the Control, not Format() function since the Format() function chanes the data-type.  In addition, the "mm" in "hh:mm am/pm" actuall means month. 

    If you want to display hours:minutes, you need to use "hh:nn am/pm" ("nn" for minutes as 2 digits).

       


    Van Dinh

    • Marked as answer by cfreema7 Monday, September 09, 2013 10:30 PM
    Monday, September 09, 2013 7:56 AM

All replies

  • Use the DateAdd function to add minutes. Like:

    Task_End = DateAdd("n", Task_Dur, Task_Start)


    Groeten, Peter http://access.xps350.com/

    • Marked as answer by cfreema7 Monday, September 09, 2013 10:30 PM
    Monday, September 09, 2013 7:44 AM
  • 1.  Just use

    DateAdd("n",Task_Dur,Task_Start)

    to add [Task_Dur] (15) minutes to the start time.

    2.  If it is shown in a Control on the Form, you should use the Form Property of the Control, not Format() function since the Format() function chanes the data-type.  In addition, the "mm" in "hh:mm am/pm" actuall means month. 

    If you want to display hours:minutes, you need to use "hh:nn am/pm" ("nn" for minutes as 2 digits).

       


    Van Dinh

    • Marked as answer by cfreema7 Monday, September 09, 2013 10:30 PM
    Monday, September 09, 2013 7:56 AM