Viewing 15 posts - 42,961 through 42,975 (of 59,098 total)
First of all, that table is setup for CDR's (Call Detail Records). Rather I should say it's set up incorrectly for CDR's. Almost all of the columns are...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 18, 2009 at 12:18 pm
Gosh... even though this is just a reporting table, I still wouldn't add the 10 columns to it unless it were trully normalized data. What is in the 10...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 18, 2009 at 11:51 am
Let me come right out and say it... don't use CONVERT to strip the time... it's at least ten times slower than just about any other method.
So far as testing...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 18, 2009 at 11:44 am
Thanks for the feedback, TJ.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 18, 2009 at 8:11 am
Absolutely, Lynn. Nicely done.
As a side bar, I used to believe that correlated sub-queries were a form of RBAR and, in many cases, they absolutely are and will have...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 18, 2009 at 7:28 am
kylejw (7/18/2009)
Thanks guys,Yes, I've used Group By but until now I've never looked at Sum from a SQL perspective. Like everything, its quite obvious when you know how 🙂
No problem......
--Jeff Moden
Change is inevitable... Change for the better is not.
July 18, 2009 at 7:17 am
dave b (7/17/2009)
Yeah...I do understand...kinda. 😉 I like the CTE solution. I was just thinking that there was a simpler way with less code.
Heh... nah... I was talking about why...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 18, 2009 at 7:05 am
tsmith (7/18/2009)
--Jeff Moden
Change is inevitable... Change for the better is not.
July 18, 2009 at 7:02 am
Of course, this hasn't been tested because I don't have the table structures nor the test data... but it should be close...
select FiscalMonthDTTM, left(datename(month,FiscalMonthDTTM),3) Mth,
Sum(case when TimeType='YVW Crib' then...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 11:21 pm
dave b (7/17/2009)
Thanks Bruce! I'll give it a try.
I'm just making sure... you understand why Bruce's solution will work, correct?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 11:14 pm
tsmith (7/17/2009)
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 11:11 pm
TRACEY (7/17/2009)
How to sort this by every 15 minutes. Or Every 10 minutes.
I'll have to remember that's how you ask for a "nudge" in the future.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 11:07 pm
Almost forgot... if you don't know what a Tally table is or how it replaces a loop, please see the following article...
http://www.sqlservercentral.com/articles/T-SQL/62867/
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 10:53 pm
tsmith (7/17/2009)
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 10:51 pm
TRACEY (7/17/2009)
I take a look, i only wanted the command not the entire program 🙂
Heh... understood. Would you have been able to figure it out if I were to...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 9:51 pm
Viewing 15 posts - 42,961 through 42,975 (of 59,098 total)