By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,824 Members | 2,359 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,824 IT Pros & Developers. It's quick & easy.

Time is not on my side!!!

Presto731
P: 53
Ok, here is my query quandry

This may be more of a math question but I need help anyway. I should have paid attentionin high school i guess

I have a large amount of data that that is entered each day into a database. Two peices of the data need to be divided by each other to arrive at a percentage. Both types of data are time. However both come to me in a different format.

Here is an example of how they come:
[Time1] comes as a decimal format. 8.17 hours is 490.2 minutes or 8 hours 10 minutes.

[Time2] comes as a hour:minute format. 1:11 is 71 minutes or 1 hour 11 minutes.

The math that needs to take place is [time2]/[time1] which in this case would be 14.5%

Question 1: What should the field types of my data be in the table for both?
Question 2: How do I convert one or both to the right number types in a equation to get the right percentage?

Obviously I could have the people who enter the data do exactly what I did above, however its a large amount of data on a daily basis and would not be productive to do so. I also want to eliminate human error as much as possible.

Any help and suggestions offered would be highly appreciated

Thanks
Aug 26 '08 #1
Share this Question
Share on Google+
1 Reply


100+
P: 167
What you want is to turn these values into minutes in order to calculate the percent.

Obviously Time1 is a number and not time type.

So in your query create 3 new fields like this:
[HTML]MinutesT1:Time1*60
MinutesT2:(Hour([Time2])*60)+Minute([Time2])
Percent:MinutesT2/MinutesT1[/HTML]
Aug 26 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.