473,395 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Total short time fields in query

I'm working on a project that was dropped in my lap. It is in Access
2003. There are short time fields which get calculated values (eg.
1:30). But I will need to total up those values for reports in
qiueries. When I tried to drop one of the fields in the query builder
and used the total function the totals was way off.

So I was wondering what would be the best way to do this? Thanks in
advance for the help.
Jun 27 '08 #1
7 2126
I think generally that you do not want to total times. What would the total
of 18:00 and 14:30 and 4:00 mean or be useful for? Perhaps the result of
subtracting one time from another, yielding elapsed times can be added
usefully?

Regards

Kevin

"Ecohouse" <ec*********@yahoo.comwrote in message
news:34**********************************@k37g2000 hsf.googlegroups.com...
I'm working on a project that was dropped in my lap. It is in Access
2003. There are short time fields which get calculated values (eg.
1:30). But I will need to total up those values for reports in
qiueries. When I tried to drop one of the fields in the query builder
and used the total function the totals was way off.

So I was wondering what would be the best way to do this? Thanks in
advance for the help.

Jun 27 '08 #2
I normally don't do it this way either. In the end they want reports
that will show totals and that is what I'm working on. I'm trying to
figure out the best way to deal with this issue.

Any other ideas?

On May 4, 6:01*pm, "KC-Mass" <connearneyATcomcastDOTnetwrote:
I think generally that you do not want to total times. *What would the total
of 18:00 and 14:30 and 4:00 mean or be useful for? *Perhaps the result of
subtracting one time from another, yielding elapsed times can be added
usefully?

Regards

Kevin

"Ecohouse" <ecovinda...@yahoo.comwrote in message

news:34**********************************@k37g2000 hsf.googlegroups.com...
I'm working on a project that was dropped in my lap. *It is in Access
2003. *There are short time fields which get calculated values (eg.
1:30). *But I will need to total up those values for reports in
qiueries. *When I tried to drop one of the fields in the query builder
and used the total function the totals was way off.
So I was wondering what would be the best way to do this? *Thanks in
advance for the help.- Hide quoted text -

- Show quoted text -
Jun 27 '08 #3
"Ecohouse" <ec*********@yahoo.comwrote in message
news:34**********************************@k37g2000 hsf.googlegroups.com...
I'm working on a project that was dropped in my lap. It is in Access
2003. There are short time fields which get calculated values (eg.
1:30). But I will need to total up those values for reports in
qiueries. When I tried to drop one of the fields in the query builder
and used the total function the totals was way off.

So I was wondering what would be the best way to do this? Thanks in
advance for the help.
I'm confused, when you say "there are short time fields" do you mean a field
containing values like 3:30pm, 4:00pm, 12:14am, etc? Or do you mean a field
containing values of elapsed time like 1.20 secs, 5.50 hrs, etc. The former
is formatted as date/time, the latter is a number. A summation of the former
doesn't make sense, but the summation of the latter does.
Fred Zuckerman
Jun 27 '08 #4
A field would have the value of 1:30. This would represent one hour
and thirty minutes. I didn't set this up and now I'm stuck with it
and trying to figure out a way to deal with this.

So I have to create reports where I will be grouping departments and I
need the total hours and minutes. I'm trying to do this using the
query builder. Any ideas?

On May 5, 4:25*am, "Fred Zuckerman" <Zuckerm...@sbcglobal.netwrote:
"Ecohouse" <ecovinda...@yahoo.comwrote in message

news:34**********************************@k37g2000 hsf.googlegroups.com...
I'm working on a project that was dropped in my lap. *It is in Access
2003. *There are short time fields which get calculated values (eg.
1:30). *But I will need to total up those values for reports in
qiueries. *When I tried to drop one of the fields in the query builder
and used the total function the totals was way off.
So I was wondering what would be the best way to do this? *Thanks in
advance for the help.

I'm confused, when you say "there are short time fields" do you mean a field
containing values like 3:30pm, 4:00pm, 12:14am, etc? Or do you mean a field
containing values of elapsed time like 1.20 secs, 5.50 hrs, etc. The former
is formatted as date/time, the latter is a number. A summation of the former
doesn't make sense, but the summation of the latter does.
Fred Zuckerman
Jun 27 '08 #5
I think the basic problem is that your predecessor used the wrong data type.
The data should have been stored as a number.

Try converting it to a number in a query. Put an Expression in the query
that
multiplies the timefield by 1440 (giving minutes) and divide that by 60
(giving hours).

A "Time" of 3:30 will give you 3.50. You can the sum those values.

The SQL would be something like:
"SELECT Sum([timeforprocess]*1440/60) AS NumbersFROM tblTime; "

I am guessing this is what you need.

Regards
Kevin


"Ecohouse" <ec*********@yahoo.comwrote in message
news:34**********************************@k37g2000 hsf.googlegroups.com...
I'm working on a project that was dropped in my lap. It is in Access
2003. There are short time fields which get calculated values (eg.
1:30). But I will need to total up those values for reports in
qiueries. When I tried to drop one of the fields in the query builder
and used the total function the totals was way off.

So I was wondering what would be the best way to do this? Thanks in
advance for the help.

Jun 27 '08 #6
Ecohouse <ec*********@yahoo.comwrote in
news:3d824645-d110-47a3-958d-170c4afa394a@
24g2000hsh.googlegroups.com
:
A field would have the value of 1:30. This would represent one
hour and thirty minutes. I didn't set this up and now I'm stuck
with it and trying to figure out a way to deal with this.

So I have to create reports where I will be grouping departments
and I need the total hours and minutes. I'm trying to do this
using the query builder. Any ideas?
So you are talking of durations and not times. Access stores the
date and time as the number of dats since Dec 31, 1899 and the
fraction of the day reresents the time. e.g. noon is 0,5, 6:00 pm is
0.75.

So first you need to determine if there is a hidden date in the
field, then subtract that from the shown value, and total the
fractions, then redisplay as as a duration.

If instead the time is stored in a text field, not date-time, you
will need to write a function in Visual basic code to split the
parts into a fraction of a day, then sum and reformat as a duration.

until anyone can give you specific instructions, we'll need to know
1) the field type (open the table in design mode),
2) the field format,
3) if a datetime field, whether the dates are all 12-31-1899 or
various recent dates, build a query and format the field as general
date.

Q

On May 5, 4:25*am, "Fred Zuckerman" <Zuckerm...@sbcglobal.net>
wrote:
>"Ecohouse" <ecovinda...@yahoo.comwrote in message

news:3476a795-6e48-4aad-8f80-
c3**********@k37g2000hsf.googlegroups
>.com...
I'm working on a project that was dropped in my lap. *It is in
Access 2003. *There are short time fields which get calculated
values (eg. 1:30). *But I will need to total up those values
for reports in qiueries. *When I tried to drop one of the
fields in the query builder
and used the total function the totals was way off.
So I was wondering what would be the best way to do this?
*Thanks in advance for the help.

I'm confused, when you say "there are short time fields" do you
mean a fie
ld
>containing values like 3:30pm, 4:00pm, 12:14am, etc? Or do you
mean a fiel
d
>containing values of elapsed time like 1.20 secs, 5.50 hrs, etc.
The forme
r
>is formatted as date/time, the latter is a number. A summation of
the form
er
>doesn't make sense, but the summation of the latter does.
Fred Zuckerman



--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Jun 27 '08 #7
I was able to search around on the internet and find out what I
needed. Thanks for all the help.

On May 5, 5:57*pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
Ecohouse <ecovinda...@yahoo.comwrote in
news:3d824645-d110-47a3-958d-170c4afa394a@
24g2000hsh.googlegroups.com
:
A field would have the value of 1:30. *This would represent one
hour and thirty minutes. *I didn't set this up and now I'm stuck
with it and trying to figure out a way to deal with this.
So I have to create reports where I will be grouping departments
and I need the total hours and minutes. *I'm trying to do this
using the query builder. *Any ideas?

So you are talking of durations and not times. Access stores the
date and time as the number of dats since Dec 31, 1899 and the
fraction of the day reresents the time. e.g. noon is 0,5, 6:00 pm is
0.75.

So first you need to determine if there is a hidden date in the
field, then subtract that from the shown value, and total the
fractions, then redisplay as as a duration.

If instead the time is stored in a text field, not date-time, you
will need to write a function in Visual basic code to split the
parts into a fraction of a day, then sum and reformat as a duration.

until anyone can give you specific instructions, we'll need to know
1) the field type (open the table in design mode),
2) the field format,
3) if a datetime field, whether the dates are all 12-31-1899 or
various recent dates, build a query and format the field as general
date.

Q
On May 5, 4:25*am, "Fred Zuckerman" <Zuckerm...@sbcglobal.net>
wrote:
"Ecohouse" <ecovinda...@yahoo.comwrote in message
news:3476a795-6e48-4aad-8f80-

c34a494b6...@k37g2000hsf.googlegroups


.com...
I'm working on a project that was dropped in my lap. *It is in
Access 2003. *There are short time fields which get calculated
values (eg. 1:30). *But I will need to total up those values
for reports in qiueries. *When I tried to drop one of the
fields in the query builder
and used the total function the totals was way off.
So I was wondering what would be the best way to do this?
*Thanks in advance for the help.
I'm confused, when you say "there are short time fields" do you
mean a fie
ld
containing values like 3:30pm, 4:00pm, 12:14am, etc? Or do you
mean a fiel
d
containing values of elapsed time like 1.20 secs, 5.50 hrs, etc.
The forme
r
is formatted as date/time, the latter is a number. A summation of
the form
er
doesn't make sense, but the summation of the latter does.
Fred Zuckerman

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**- Hide quoted text -

- Show quoted text -
Jun 27 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Justin Hoffman | last post by:
This is a question concerning query optimisation. Sorry if it's a bit long, but thanks to anyone who has the patience to help - This is my first post here... If I have two tables:...
0
by: Galina | last post by:
Hello My form is based on a query returning rows of a table. Practically, it is based on a table, so simple the query is. A field on the form is formatted as short time. The column in the table,...
3
by: CSDunn | last post by:
Hello, I have 14 fields on a report that hold integer values. The field names use the following naming convention: T1Number, T2Number ....T14Number. I need to get a 'sub total' of all fields as...
2
by: MLH | last post by:
I have tblMemberLogins with and fields. Any member may appear in the table numerous times. How can I sum up the total time spent logged in by any member in the table, I can extract the records...
2
by: phaddock4 | last post by:
Please help. GOAL: I hope to calculate a total amount in a TotalQuery (or field in the SubQuery?), based upon three field amounts in a SubQuery. STATUS: When I create an expression in the...
4
by: Stephen Young | last post by:
Hello Have a bit of a problem, im trying to get the total number of hours:minutes for all actions over the month in a query, have tried two methods to no luck... Duration This Month:...
4
by: mukeshhtrivedi | last post by:
I have TYPE field which has 3 data like HEAD, TRACK and PANEL. Now whenever any person works on HEAD we put 8 Hrs in HRS filed and in LABOR field it reflects the dollar value automatically like...
1
by: Blue Lagoon Products - Customer Services | last post by:
Hi, I am in a bit of a pickle...I need to know the Total figure of the gross field in my table between 2 dates specified in a query. I need to know what criteria to put into my query on the...
1
by: iht | last post by:
Fairly new to Access and really doesn't know much about SQL except some basic commands. Currently I'm working with a database that I've already sorted by some queries, and here's a simplified...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.