SkipFeeney
SkipFeeney

Reputation: 81

Need to store a large number of hours and minutes (ie 36:30) best method?

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

Answers (1)

Jon Skeet
Jon Skeet

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

Related Questions