Viewing 15 posts - 2,611 through 2,625 (of 4,085 total)
yb751 (6/1/2016)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 1, 2016 at 8:52 am
marcossuriel (5/31/2016)
I replaced the variables with my table names (which are saved and contain data) on my SQL Server, but it does not work. I get "Invalid object name"...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 1, 2016 at 8:18 am
I never use query designer, because I hate the code that it writes.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 31, 2016 at 3:44 pm
marcossuriel (5/31/2016)
Thanks for your reply. I see that your code starts with:
;
WITH
I'm getting an error saying that the variable, is some of your code missing?
Also, I included the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 31, 2016 at 1:46 pm
Even though you said that you attached desired results, I'm not seeing them. Would the following work?
;
WITH LotHistOrdered AS (
SELECT *, ROW_NUMBER()OVER(PARTITION BY lh.LotNo ORDER BY lh.TransType DESC, lh.TransDate...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 31, 2016 at 11:52 am
Why do you want to skip the first row in subsequent tables?
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 31, 2016 at 10:05 am
In SQL 2008, you would use RAISERROR rather than THROW. RAISERROR is being deprecated, so you should use THROW if you are on SQL 2012 or higher.
Drew
PS: If you...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 31, 2016 at 8:17 am
The reason that we ask for sample data and expected output, is because it is often very difficult to describe in words what you are looking for. Your description...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 27, 2016 at 1:25 pm
I think it would be better to approach this as combining the tables into a single output and then applying the OFFSET/FETCH to that single output.
SELECT *, 1 AS table_num
FROM...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 27, 2016 at 12:02 pm
Looking at your queries, it looks like you may not realize that you can join to the same table multiple times as long as they have different aliases.
SELECT *
FROM Join_Details...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 27, 2016 at 11:15 am
Please provide sample data and expected results as indicated by the link in my signature.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 27, 2016 at 11:06 am
Yes, return a NULL and let the presentation layer deal with displaying 'N/A' when the field is NULL. It is best to leave this type of formatting to the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 27, 2016 at 10:20 am
RBarryYoung (5/27/2016)
Anyone else going to SQL Saturday in Philly next week? I don't think I recognized anyone on the speakers list...
I'm going to be there and both WayneS and...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 27, 2016 at 10:08 am
Lynn Pettis (5/26/2016)
This:
SELECT [GL Description], SUM(Amount) AS [Prior YTD Amount], Year
FROM dbo.vlv_PriorYrDetailExpenses
GROUP BY [GL Description], Year
HAVING (Year = @Year) AND (Month <= @Month)
It's going to complain about the Month...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 26, 2016 at 3:21 pm
SELECT *, CAST(COUNT(sales) OVER(PARTITION BY e.customerId) AS BIT)
FROM #example e
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
May 26, 2016 at 1:39 pm
Viewing 15 posts - 2,611 through 2,625 (of 4,085 total)