TomasCrossroads
Programmer
Hello,
I think my question is rather stupid, but I was wondering what data structure I use best to store time-based data. I have to store the workhours spent each day for the employess of a company. First only hours were to be stored, so I used an integer value. A day could consist of 7 workhours, 8 workhours, ...
Now they want me to keep an exact time for each day. For example: 8 hours and 23 minutes.
Now what is the best choice as data type?
I could use 2 integer values: 1 for hours and 1 for minutes
Or a real value? For example 1.60 would be 1 hours and 36 minutes then...
Or should I use a smalldatetimevalue?
I have to do a lot of calculations with those data, so it has to be easy to use...
I'm rather new in the business, what's the common practice for this kind of problem?
Thanks
Tomas
I think my question is rather stupid, but I was wondering what data structure I use best to store time-based data. I have to store the workhours spent each day for the employess of a company. First only hours were to be stored, so I used an integer value. A day could consist of 7 workhours, 8 workhours, ...
Now they want me to keep an exact time for each day. For example: 8 hours and 23 minutes.
Now what is the best choice as data type?
I could use 2 integer values: 1 for hours and 1 for minutes
Or a real value? For example 1.60 would be 1 hours and 36 minutes then...
Or should I use a smalldatetimevalue?
I have to do a lot of calculations with those data, so it has to be easy to use...
I'm rather new in the business, what's the common practice for this kind of problem?
Thanks
Tomas