How to add dates more than hour

CVAR23

New Member
Joined
Jun 29, 2016
Messages
4
This is my first database in Access and I've been able to format and add date under 60 mins using the dateadd function... but I can't add dates OVER 1 hour like, 1:20, 1:25...etc...it just says type mismatch, and I can't find any solution to this problem, neither Microsoft or the web gives me any example of the Dateadd function when it comes to add hours + minutes ....



Code:
 [FONT='inherit']DateAdd("n", d, l)[/FONT]
Code:


Code:
[FONT='inherit']DateAdd("H", d, l)[/FONT]
Code:

"n" = format any minute amount from 0 to 59 depending the case

"H" = format hours from 1 to 24

d = 1:20(one hour and twenty minutes)(datepart) or 0:20(twenty minutes)(datepart)

l = The "actual" time (8:00 AM) (current time)



ex. Dateadd("n", "0:20", 8:00 AM)
Already did the example above (d = 0:20) in the program , It returns me 8:20 AM without a problem, but. the next one...

ex. Dateadd("H",1, 8:00 AM)

The above example will return 9 AM

Im a little confused about using the dateadd() function, because If I were to add "2:30" or 4:00 (interval) to the equation, I don't know how to put that, I'd had to convert it to minutes (2:30 = 150 mins, 4:00 = 240 mins) is this correct? I've only seen examples with intervals in entire hours or minutes, but nothing combining both, i guess since its an interval I can't have both?...
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
the code brackets in blank were meant to be in blank, I just couldn't find the edit option to delete them
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top