Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
purisqlserver
Yak Posting Veteran
73 Posts |
Posted - 2004-05-15 : 08:33:10
|
Hi,I have a table , which maintains the daily_status, this table has an entry for each date, stating whether its a holidays or normal working day.If a Asset breaksdown , the start date and end date for it , is maintained in different table.Now the question is , to calculate the breakdowntime (or the time taken to clear the breakdown),we have to leave out the holidays,sundays(maintained in daily_status) to calculate the actual breakdowntime.can someone suggest a good design for this or how to go abt calculating the breakdowntime to show it in the reports.Thanx in advance.. |
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-05-15 : 16:43:21
|
1. Find the range of the breakdown (datediff).2. Do a count of days in the daily_status table between range of breakdown where days <> 'normal working day'.3. Add the two numbers together.Is that what you are looking for? You shouldn't need to do any design for this. Just build your query accordingly.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
purisqlserver
Yak Posting Veteran
73 Posts |
Posted - 2004-05-16 : 08:03:44
|
Thanx derrick............. |
 |
|
|
|
|