From: Kelly on
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,
From: John W. Vinson on
On Sat, 5 Jun 2010 19:33:30 -0700, Kelly <Kelly(a)discussions.microsoft.com>
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,

Sure:

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

--

John W. Vinson [MVP]
From: Kelly on
That worked perfect! Thank You

"John W. Vinson" wrote:

> On Sat, 5 Jun 2010 19:33:30 -0700, Kelly <Kelly(a)discussions.microsoft.com>
> 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,
>
> Sure:
>
> TotalTime: Round(Sum(DateDiff("n",[StartTime],[EndTime])/60),2)
>
> --
>
> John W. Vinson [MVP]
> .
>
 | 
Pages: 1
Prev: date and time query
Next: Multiple tables search