Time total

G

Guest

Hello All, I need some help with creating a query to sum a total time of a
field.

I have a table called client services and have a query which pulls: date of
service, total time, and provider name. I would like to be able to create a
query which will sum the total time field. I have look at other posts on here
but am still confused. Also not sure what time set to use: minutes or
hour/minute format.

Thanks for your help,
-Mark
 
D

Dale Fye

Mark,

I assume that you want to total time across clients, do you want to do it
for a specific period, (June 07) or just get the total time?

To get the total time, for each client, assuming that your [Total Time]
field is in minutes, your query would look something like:

SELECT ClientID, Sum([Total Time]) as ClientTime
FROM tblClientServices
GroupBy ClientID

If you want it for a specific period (Year), then you could do something
like:

SELECT ClientID, Sum([Total Time]) as TotalClientTime
FROM tblClientServices
WHERE Year([ServiceDateField]) = 2007
GroupBy ClientID

Again, Assuming this is in minutes, you could then write another query to
format the TotalClientTime as hh:mm format

Select ClientID, Format(TotalClientTime/60, "00") & ":" &
Format(TotalClientTime Mod 60, "00) as CumClientTime
FROM previousQuery

HTH
Dale
 
G

Guest

Thanks Dale, when I plug this formula in it gives me a blank response. I also
tried making another query with only total time and it did the same. Any
ideas. Thanks again
-Mark

Dale Fye said:
Mark,

I assume that you want to total time across clients, do you want to do it
for a specific period, (June 07) or just get the total time?

To get the total time, for each client, assuming that your [Total Time]
field is in minutes, your query would look something like:

SELECT ClientID, Sum([Total Time]) as ClientTime
FROM tblClientServices
GroupBy ClientID

If you want it for a specific period (Year), then you could do something
like:

SELECT ClientID, Sum([Total Time]) as TotalClientTime
FROM tblClientServices
WHERE Year([ServiceDateField]) = 2007
GroupBy ClientID

Again, Assuming this is in minutes, you could then write another query to
format the TotalClientTime as hh:mm format

Select ClientID, Format(TotalClientTime/60, "00") & ":" &
Format(TotalClientTime Mod 60, "00) as CumClientTime
FROM previousQuery

HTH
Dale

Markitos said:
Hello All, I need some help with creating a query to sum a total time of a
field.

I have a table called client services and have a query which pulls: date
of
service, total time, and provider name. I would like to be able to create
a
query which will sum the total time field. I have look at other posts on
here
but am still confused. Also not sure what time set to use: minutes or
hour/minute format.

Thanks for your help,
-Mark
 

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