Help!

DateDiff

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions RSS
Next:  Publisher 2007 Embedded swf not showing in Mozill..  
Author Message
Koulla
External


Since: Nov 03, 2009
Posts: 2



PostPosted: Tue Nov 03, 2009 4:05 am    Post subject: DateDiff
Archived from groups: microsoft>public>access (more info?)

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
Back to top
Jerry Whittle
External


Since: Mar 03, 2006
Posts: 1240



PostPosted: Tue Nov 03, 2009 6:40 am    Post subject: RE: DateDiff [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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" wrote:

> 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
Back to top
Rick Brandt
External


Since: Nov 04, 2004
Posts: 28



PostPosted: Tue Nov 03, 2009 8:10 am    Post subject: Re: DateDiff [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 03 Nov 2009 04:05:01 -0800, Koulla wrote:

> 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.



--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Back to top
John Spencer
External


Since: Jul 15, 2009
Posts: 47



PostPosted: Tue Nov 03, 2009 9:27 am    Post subject: Re: DateDiff [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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 Brandt wrote:
> On Tue, 03 Nov 2009 04:05:01 -0800, Koulla wrote:
>
>> 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.
>
>
>
Back to top
Koulla
External


Since: Nov 03, 2009
Posts: 2



PostPosted: Wed Nov 04, 2009 12:34 am    Post subject: RE: DateDiff [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

"Jerry Whittle" wrote:

> 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" wrote:
>
> > 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
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum