Sum and DateDiff

K

Kelly

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,
 
J

John W. Vinson

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)
 
K

Kelly

That worked perfect! Thank You

John W. Vinson said:
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)
 

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

Top