A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sum and DateDiff



 
 
Thread Tools Display Modes
  #1  
Old June 6th, 2010, 03:33 AM posted to microsoft.public.access.queries
Kelly
external usenet poster
 
Posts: 469
Default Sum and DateDiff

Hi,
I doing a calculation in a query of the difference in times. I'm wondering
if I can control the decimal precision to be just (2) places. The number I
end up with is ie; 5.6666666666, can I have this to round off to something
like 5.67?

Here is the query expression I'm using for this;

TotalTime: Sum(DateDiff("n",[StartTime],[EndTime])/60)

Thanks you,
  #2  
Old June 6th, 2010, 03:42 AM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Sum and DateDiff

On Sat, 5 Jun 2010 19:33:30 -0700, Kelly
wrote:

Hi,
I doing a calculation in a query of the difference in times. I'm wondering
if I can control the decimal precision to be just (2) places. The number I
end up with is ie; 5.6666666666, can I have this to round off to something
like 5.67?

Here is the query expression I'm using for this;

TotalTime: Sum(DateDiff("n",[StartTime],[EndTime])/60)

Thanks you,


Su

TotalTime: Round(Sum(DateDiff("n",[StartTime],[EndTime])/60),2)

--

John W. Vinson [MVP]
  #3  
Old June 6th, 2010, 04:58 AM posted to microsoft.public.access.queries
Kelly
external usenet poster
 
Posts: 469
Default Sum and DateDiff

That worked perfect! Thank You

"John W. Vinson" wrote:

On Sat, 5 Jun 2010 19:33:30 -0700, Kelly
wrote:

Hi,
I doing a calculation in a query of the difference in times. I'm wondering
if I can control the decimal precision to be just (2) places. The number I
end up with is ie; 5.6666666666, can I have this to round off to something
like 5.67?

Here is the query expression I'm using for this;

TotalTime: Sum(DateDiff("n",[StartTime],[EndTime])/60)

Thanks you,


Su

TotalTime: Round(Sum(DateDiff("n",[StartTime],[EndTime])/60),2)

--

John W. Vinson [MVP]
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.