Reputation: 81
I need to store in SQL Server 2005 an 'amount of time' for an application that records monthly overtime. E.g. someone could do 36 hours and 30 minutes overtime in one month. I need to store this and carry out calculations on it - what would be the best method.
Thanks
Upvotes: 4
Views: 136
Reputation: 1500765
Why not just store the number of minutes in a single integer column? That's the ideal representation for calculations (e.g. totals, ordering etc), and you can easily split it into hours and minutes when you need to format it.
Upvotes: 6