Viewing 15 posts - 2,701 through 2,715 (of 3,484 total)
Try using DelimitedSplit8K.
Read this article:http://www.sqlservercentral.com/articles/Tally+Table/72993/
Folks here help people, they don't usually do their work for them. So show us what you tried...
January 19, 2015 at 11:06 pm
Your data is contradictory. A vehicle is moving whenever Speed>0, but your data says that it's not moving unless speed>1.
If you have SQL Server 2012 or later this can...
January 18, 2015 at 12:09 am
Yes to all three.
The confusing part for me was how to compare a group of sales from one year to another year when the territory definitions are changing. (So that...
January 15, 2015 at 7:30 pm
Jeff,
Oh, I think I get it now... So each time a customer got assigned to a different territory, then I would have to create a new record for that customer...
January 15, 2015 at 7:27 pm
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
Viewing 15 posts - 2,701 through 2,715 (of 3,484 total)