DateDiff

K

Koulla

Hi I am using date time field in this format 8/10/2009 10:00:00 pm and I am
using datediff to find the different but it appears only in minutes !
I want to separate different on days, Hours and Minutes !

This is what I am using
=(DateDiff("n",[DateBreakable],[DateResponce])) it works ok but only minutes
appears I want difference in day, Hours and minutes something like that
2Days, 2Hours, 34Minutes

Thanks in advance
Koulla
 
R

Rick Brandt

Hi I am using date time field in this format 8/10/2009 10:00:00 pm and I
am using datediff to find the different but it appears only in minutes !
I want to separate different on days, Hours and Minutes !

This is what I am using
=(DateDiff("n",[DateBreakable],[DateResponce])) it works ok but only
minutes appears I want difference in day, Hours and minutes something
like that 2Days, 2Hours, 34Minutes

Thanks in advance
Koulla

There is no built in function in Access that does that. You could of
course create a custom function in which you do the math yourself and
return a text string in that format.

One of the regulars in these groups (I want to say Albert, but that could
be wrong) has already written a function that does what you want. If you
search these groups you might be able to find a post referring to it.
 
J

John Spencer

Try the "More Complete DateDiff Function" Graham Seach and Doug Steele wrote.

http://www.accessmvp.com/djsteele/Diff2Dates.html

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Rick said:
Hi I am using date time field in this format 8/10/2009 10:00:00 pm and I
am using datediff to find the different but it appears only in minutes !
I want to separate different on days, Hours and Minutes !

This is what I am using
=(DateDiff("n",[DateBreakable],[DateResponce])) it works ok but only
minutes appears I want difference in day, Hours and minutes something
like that 2Days, 2Hours, 34Minutes

Thanks in advance
Koulla

There is no built in function in Access that does that. You could of
course create a custom function in which you do the math yourself and
return a text string in that format.

One of the regulars in these groups (I want to say Albert, but that could
be wrong) has already written a function that does what you want. If you
search these groups you might be able to find a post referring to it.
 
J

Jerry Whittle

Format(CDate(DateDiff("n",[DateBreakable],[DateResponce)/1440) +1 , "d:h:m")

I bet that there's a better way, but it's all that I got.
 
K

Koulla

Thank you Jerry it works perfectly
Thank you so much !!!

Jerry Whittle said:
Format(CDate(DateDiff("n",[DateBreakable],[DateResponce)/1440) +1 , "d:h:m")

I bet that there's a better way, but it's all that I got.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Koulla said:
Hi I am using date time field in this format 8/10/2009 10:00:00 pm and I am
using datediff to find the different but it appears only in minutes !
I want to separate different on days, Hours and Minutes !

This is what I am using
=(DateDiff("n",[DateBreakable],[DateResponce])) it works ok but only minutes
appears I want difference in day, Hours and minutes something like that
2Days, 2Hours, 34Minutes

Thanks in advance
Koulla
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top