Viewing 15 posts - 42,931 through 42,945 (of 59,063 total)
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
Now... if you want to know a bit more about each table including the row counts, try this...
--_______________________________________________________________________________________________________________________
/**********************************************************************************************************************
Purpose:
Returns a single result set similar to sp_Space used for all...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 9:45 pm
You bet. Thanks for the feedback, TJ.
But I wasn't the first one to suggest it on this thread. Go back and look at what dobrzak wrote earlier. ...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 9:31 pm
It's not possible with the current information because there's nothing to identify the difference between the street and the city.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 4:20 pm
Heh... and the read up on proper table design so you can tell the folks who designed that table how to fix it. 😛
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 4:17 pm
TAman (7/17/2009)
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2009 at 4:14 pm
Viewing 15 posts - 42,931 through 42,945 (of 59,063 total)