Viewing 15 posts - 2,701 through 2,715 (of 3,480 total)
I would look around for Jeff Moden's article(s) on hierarchies. Not sure if he uses a CTE or not.
January 15, 2015 at 5:41 pm
The code helps some, but a table definition (create table script) for the table the data is in would help a lot. (and some sample data).
On to the question...
January 15, 2015 at 12:42 pm
If you want to group the non-top 5 into one group, then you could do it in T-SQL and then create your report based on that.
Here's a quick sample (sorry,...
January 14, 2015 at 9:07 pm
Something is odd here. How are you creating your grand totals?
Can you post a report with dummy data, so we can recreate the problem?
I've just never heard of totals...
January 14, 2015 at 11:14 am
Re-reading this... Welcome!
Those are ROWS, thank goodness! Across columns is NOT fun. Best way is to post consumable data...
This looks like it works:
SELECT P.Id, P.Price, P.CurType,...
January 13, 2015 at 10:49 pm
What I want to do, is allow the user to select ALL results, or only the results that are above the specified limit for each limit
A simplified version of your...
January 13, 2015 at 9:33 pm
This is the logical equivalent of a V/HLOOKUP in Excel. Something like this should work:
DECLARE @SalePrice SMALLMONEY = 250.00;
SELECT MAX(Bonus)
FROM #CompPlan
WHERE HighVal<@SalePrice;
-- sorry, I guess I left one thing...
January 11, 2015 at 6:25 pm
all dbs not accessed before (or do you mean since) a given date...
Exercise your GoogleFu.
Found this pretty quickly:
http://dinesql.blogspot.com/2010/05/when-was-my-sql-server-database-last.html
I tweaked it a little, but I may have misunderstood the filter you...
January 10, 2015 at 11:52 pm
Let me see if rephrasing this will help. I'm wondering how to model sales territories when the "borders" move over time.
Same basic sales database (think Contoso DW... it's just less...
January 10, 2015 at 11:31 pm
I have to admit that I know little about MySQL, but you should be able to use something like this:
WHERE event_time>DATEADD(m,-2,GETDATE())
(subtracts two months from the current date).
January 7, 2015 at 3:43 pm
one way would be to create a view and then put the aliases there.
CREATE VIEW vw_SomeView
AS
SELECT field1 AS NewName
,field2...
January 6, 2015 at 12:36 pm
Deleting posts (unless completely absurd) seems odd to me. To me, it's like tearing pages out of a knowledge repository. Nothing quite like remembering an old post that...
January 4, 2015 at 9:15 pm
Got details??
A rough analogy to your description is like saying that "my car used to run fine, now it doesn't." The obvious response is "What changed between when it...
January 2, 2015 at 9:29 pm
Wow. That's mind-boggling!!!! I see that MS has adopted the SQL Server license model for all of its software. I wonder if they sell a decoder ring...
January 2, 2015 at 10:13 am
the only way I could think of doing it was to have a "translation" table.
Something like (CustomerID, Year, AssignedTerritoryID).
That's the only way I could figure out to be able to...
January 2, 2015 at 9:48 am
Viewing 15 posts - 2,701 through 2,715 (of 3,480 total)