Viewing 15 posts - 2,176 through 2,190 (of 8,731 total)
Another option.
Note that I'm including 2 additional possibilities to show a problem. The other 2 solutions handle it differently, but not necessarily correctly.
SELECT Symbol,
LEFT(Symbol, CHARINDEX('_',...
September 9, 2016 at 9:21 am
oaucamp (9/9/2016)
I have a table that contains one column called Symbol. The symbol consists of two or three parts. They are ticker, indicator and dimension or in some cases...
September 9, 2016 at 8:49 am
Matjaz Urank (9/9/2016)
I can't understand why technically this could be an error. But that doesn't mean that this isn't a bug. Does Microsoft...
September 9, 2016 at 7:13 am
Creating a scalar UDF to handle division by zero is a bad idea. It will only slow down queries.
What's the problem with using NULLIF?
SELECT numerator / NULLIF( denominator, 0)
You can...
September 8, 2016 at 10:50 am
There's no way anyone can help you from what you posted. You'll need to follow the indications in this article to get actual help: http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
It's not that we don't want...
September 7, 2016 at 1:17 pm
Jason A. Long (9/7/2016)
September 7, 2016 at 1:13 pm
Maybe something like this:
CASE Orders.ptemp
WHEN 'P' THEN 'Permanent'
WHEN 'T' THEN 'Temporary'
WHEN 'B' THEN 'Both'
WHEN...
September 7, 2016 at 12:36 pm
This is the closes I could get to your expected results. I have to agree with Grant, the design is incorrect.
WITH CTE AS(
SELECT OrderNumber, Location, Total...
September 7, 2016 at 7:52 am
colin.dunn (9/7/2016)
Put the join ON clauses on the same line since they were so short.
I usually have my ON clauses on the same line as my JOIN, but when he...
September 7, 2016 at 7:04 am
Grumpy DBA (9/7/2016)
Ed Wagner (9/7/2016)
PreserveMarmalade
Lady
September 7, 2016 at 6:38 am
You should also use column alias in your ORDER BY clause instead of position.
ORDER BY [Work Type] DESC, [Days Elapsed];
EDIT:
Also here are some additional comments
SELECT --Use the actual length...
September 7, 2016 at 6:28 am
Ed Wagner (9/6/2016)
Revenant (9/6/2016)
Y.B. (9/6/2016)
whereisSQL? (9/6/2016)
Hugo Kornelis (9/6/2016)
Ray K (9/6/2016)
Ed Wagner (9/6/2016)
djj (9/6/2016)
Ed Wagner (9/6/2016)
Hugo Kornelis (9/6/2016)
Stuart Davies (9/6/2016)
BWFC (9/6/2016)
TomThomson (9/6/2016)
Revenant (9/5/2016)
TreatTrick
Cheap
Canary
Wharf
Worf
Data
Riker
Island
Beach
Volleyball
Top Gun
Tomcat
Warthog
meerkat
September 6, 2016 at 12:14 pm
I believe that you're missing some parenthesis and you might need to change one of the conditions to allow the last part to be evaluated.
Update Staging
Set P_Staged_By = CASE
WHEN P_Staged_By...
September 6, 2016 at 12:12 pm
Sean Lange (9/6/2016)
September 6, 2016 at 8:08 am
Gregory Hart (9/6/2016)
if divide by zero is allowed, it's possible to prove that 1=2
The above claim would only work in a logical proof if you identified that NULL= NULL ....
September 6, 2016 at 7:01 am
Viewing 15 posts - 2,176 through 2,190 (of 8,731 total)