April 27, 2012 at 7:06 am
... was able to achieve this with code:
convert(int,((sum(datepart(hour,Timenetin) * 3600) + sum(datepart(hour,cat2_hours) * 3600) + sum(datepart(minute,Timenetin) * 60) + sum(datepart(minute,cat2_hours) * 60) + sum(datepart(second,Timenetin) * 1) + sum(datepart(second,cat2_hours) * 1))))/3600 -
((sum(datepart(hour,Monhours) * 3600) + sum(datepart(hour,Tuehours) * 3600) + sum(datepart(hour,Wedhours) * 3600) + sum(datepart(hour,Thuhours) * 3600) + sum(datepart(hour,Frihours) * 3600)
+ sum(datepart(minute,Monhours) * 60) + sum(datepart(minute,Tuehours) * 60) + sum(datepart(minute,Wedhours) * 60) + sum(datepart(minute,Thuhours) * 60) + sum(datepart(minute,Frihours) * 60) +
sum(datepart(second,Monhours) * 1) + sum(datepart(second,Tuehours) * 1) + sum(datepart(second,Wedhours) * 1) +
sum(datepart(second,Thuhours) * 1) + sum(datepart(second,Frihours) * 1)))/18000 As Hrs_Diff,
Chop some garlic in, add some chilli, cramped boiled egg, green beans and prawns, stir-fry with one spoon of veg. oil and two spoons of soya sauce.
Portion of Singaporean Noodles is ready to be boxed :hehe::hehe::hehe:
April 27, 2012 at 7:16 am
Eugene Elutin (4/27/2012)
... was able to achieve this with code:
convert(int,((sum(datepart(hour,Timenetin) * 3600) + sum(datepart(hour,cat2_hours) * 3600) + sum(datepart(minute,Timenetin) * 60) + sum(datepart(minute,cat2_hours) * 60) + sum(datepart(second,Timenetin) * 1) + sum(datepart(second,cat2_hours) * 1))))/3600 -
((sum(datepart(hour,Monhours) * 3600) + sum(datepart(hour,Tuehours) * 3600) + sum(datepart(hour,Wedhours) * 3600) + sum(datepart(hour,Thuhours) * 3600) + sum(datepart(hour,Frihours) * 3600)
+ sum(datepart(minute,Monhours) * 60) + sum(datepart(minute,Tuehours) * 60) + sum(datepart(minute,Wedhours) * 60) + sum(datepart(minute,Thuhours) * 60) + sum(datepart(minute,Frihours) * 60) +
sum(datepart(second,Monhours) * 1) + sum(datepart(second,Tuehours) * 1) + sum(datepart(second,Wedhours) * 1) +
sum(datepart(second,Thuhours) * 1) + sum(datepart(second,Frihours) * 1)))/18000 As Hrs_Diff,
Chop some garlic in, add some chilli, cramped boiled egg, green beans and prawns, stir-fry with one spoon of veg. oil and two spoons of soya sauce.
Portion of Singaporean Noodles is ready to be boxed :hehe::hehe::hehe:
Whats that supposed to mean ? I can only hope its not sarcastic.:-D
April 27, 2012 at 7:52 am
It's not, just this huge set of sum's and brackets on Friday did make me dizzy. Time for a pint!
π
April 27, 2012 at 7:54 am
Eugene Elutin (4/27/2012)
It's not, just this huge set of sum's and brackets on Friday did make me dizzy. Time for a pint!π
Stop that! It's two hours to Beer O'Clock!
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 27, 2012 at 7:55 am
Eugene Elutin (4/27/2012)
It's not, just this huge set of sum's and brackets on Friday did make me dizzy. Time for a pint!π
Careful with that axe, Eugene
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply