Viewing 15 posts - 2,911 through 2,925 (of 4,087 total)
kiril.lazarov.77 (10/15/2015)
I could pivot salesprice but not both salesprice and quantity. Is it possible? thanks
Not with one pivot, but there is nothing to stop you from using two pivots. ...
October 15, 2015 at 2:58 pm
g.britton (10/15/2015)
October 15, 2015 at 2:44 pm
Kristen-173977 (10/9/2015)
October 9, 2015 at 10:18 am
Kristen-173977 (10/9/2015)
ORDER BY
CASE WHEN EmpLogin = '-1' THEN...
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...
October 8, 2015 at 7:54 am
ScottPletcher (10/7/2015)
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...
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...
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...
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
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...
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...
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,...
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...
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
September 16, 2015 at 3:34 pm
Viewing 15 posts - 2,911 through 2,925 (of 4,087 total)