Viewing 15 posts - 91 through 105 (of 600 total)
Why did this need a new thread?
Maybe instead of doing this a bit at a time, with a new thread each time, in which nobody has anything real to work...
February 23, 2015 at 11:00 am
Select
Distinct value as value ,CASE WHEN ISNUMERIC(value) <> 0 THEN CONVERT(int,value) ELSE value END AS converted_value From TableA
This fails for two reasons.
First, '1.0' for...
February 20, 2015 at 1:51 pm
Here is his Lowell's sample modified for what you want.
WITH SampleData (ID, Pay) AS
(
SELECT 1, '1.000'
UNION ALL SELECT 2,'2.250'
...
February 20, 2015 at 1:33 pm
You can't.
You can make a function/query with output that LOOKS like that, but your output will be a string even it it looks like an integer/decimal for some rows. ...
February 20, 2015 at 10:13 am
I don't now. There's a borderline between "help me figure out this problem I'm stuck on" and "please do my job for me" and you seem to be coming...
February 19, 2015 at 6:49 pm
You want help with the query syntax, or help turning the query into an insert statement?
Does the destination table already exist (and if so, can we have DDL), or are...
February 19, 2015 at 1:41 pm
What is the datatype of surKey and what are the execution plans?
February 18, 2015 at 12:34 pm
Jason-299789 (2/18/2015)
I actually answered that QotD and got it right. :hehe:
It makes sense for there to be truncation to prevent data loss but in doing so you still suffer data...
February 18, 2015 at 8:12 am
Now check this:
SELECT CAST(@var1/100.00 AS DECIMAL(18,10))*CAST(@Var2/100.00 AS DECIMAL(18,10))*CAST (@var3/100.00 AS DECIMAL (18,10))
The precision and scale is changing with each one of your calculations, as they have maximums. ...
February 18, 2015 at 7:36 am
Rizk.Christopher (2/14/2015)
February 14, 2015 at 6:20 pm
If you are going to use top, you should probably be including an order by clause as well, to ensure that it really is the 'top 3' as you define...
February 14, 2015 at 2:26 pm
UPDATE r SET ProjAmt = 0
FROM
(
SELECT OrderID, ProjectID,ProductID,ProductName,ProjAmt,ROW_NUMBER() OVER (PARTITION BY OrderID, ProjectID ORDER BY ProductName) rn
FROM #Temp
) r
WHERE rn > 1
February 14, 2015 at 9:27 am
Ok, I've put together a sample of how I would solve it. Jeff or someone else may have a more efficient way.
Because you posted no DDL I don't have...
February 13, 2015 at 5:59 pm
Viewing 15 posts - 91 through 105 (of 600 total)