Viewing 15 posts - 2,911 through 2,925 (of 4,085 total)
g.britton (10/15/2015)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 15, 2015 at 2:44 pm
Kristen-173977 (10/9/2015)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 9, 2015 at 10:18 am
Kristen-173977 (10/9/2015)
ORDER BY
CASE WHEN EmpLogin = '-1' THEN...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 9, 2015 at 7:51 am
You have a main query, a subquery, and a sub-subquery. The table adminfee is only specified within the sub-subquery, but you are trying to reference it in the main...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 8, 2015 at 7:54 am
ScottPletcher (10/7/2015)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 7, 2015 at 2:43 pm
Your original query was very close. You're getting Element2 and Element3 twice, because you're specifying them both twice: once in the path() and once in the alias. Instead of...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 7, 2015 at 8:13 am
I think this is what you are looking for:
refkey = STUFF(
CASE
WHEN st.base <> '' and st.qttbase <> 0
THEN ',B'
ELSE ''
END +
CASE
WHEN st.cos <>'' and st.qttcos <> 0
THEN ',C'
ELSE ''
END +
CASE
WHEN...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 30, 2015 at 3:20 pm
ScottPletcher (9/30/2015)
Yikes. Here's an alternative that should perform better for you:
Part of the reason that XML string splitters are inefficient is converting character separated strings to a format that...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 30, 2015 at 1:17 pm
HTML is a subset of XML, it's probably more efficient to treat it as XML and use xquery.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 30, 2015 at 10:45 am
UNION applies to sets and stored procedures are not sets, although they may return sets. If you want to union the results of two stored procedure calls, you'll need...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 29, 2015 at 1:26 pm
Since CTEs are essentially single-use views, they follow the same rules as updatable views; specifically
Any modifications, including UPDATE, INSERT, and DELETE statements, must reference columns from only one...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 29, 2015 at 9:14 am
Perhaps I'm missing something, but if you want to look specifically at the second ticket, then COUNT is the wrong aggregate. Try the following.
WITH Ticket_Number AS (
SELECT ti.person_ID, ticket_date,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 23, 2015 at 10:11 am
I dislike the consistent "U" as a table alias for the table being updated for some of the same reasons that I dislike sequential table aliases, the most important one...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 22, 2015 at 1:34 pm
Try the FORMAT function. It was added in SQL 2012.
SELECT FORMAT(vhrgdt, '0000-00-00') + ' ' + FORMAT(vhrgtm, '00:00:00.000'), *
FROM #Something s
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 16, 2015 at 3:34 pm
This query can be greatly simplified if you look at it with a different perspective. Instead of the MAX row number within each group, you want a COUNT within...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 15, 2015 at 12:27 pm
Viewing 15 posts - 2,911 through 2,925 (of 4,085 total)