What data type should I use

  • Thread starter Thread starter Barbara
  • Start date Start date
B

Barbara

In gathering requirements I learned I will need a field
that represents how long a mfg run took and the request
was that it be entered in HHMMSS format. This RUNTIME will
then be used with another field,MASS(kg), to calculate the
production rate, [MASS]/[RUNTIME]in kg/hr. I am new to
Access so I'm not sure how exactly to proceed. Do I
collect RUNTIME as DATE/TIME type with a LONG TIME input
mask but then when I need to calculate the ProdRate somehow
(?) first convert it to hours? Help!!!!
 
I will need a field
that represents how long a mfg run took and the request
was that it be entered in HHMMSS format. This RUNTIME will
then be used with another field,MASS(kg), to calculate the
production rate, [MASS]/[RUNTIME]in kg/hr.

DateTime fields do not perform well in this situation -- I would recommend
a numeric field: one of

(a) a Float (ie Single or Double) to hold the number of hours as a
fraction, eg 03:30:00 would be 3.50. You'd have to do a little bit of vba
manipulation behind the form to make it user-friendly

(b) an integer to hold the number of minutes or seconds. Once again you'd
need something to make the user input easy, but it's not that bad. If you
use seconds, it's just a matter of changing the production rate formula in
the query to Mass/CDbl(Runtime)*3600 without forgetting to cast it into a
proper number!

Hope that helps


Tim F
 
Back
Top