Viewing 15 posts - 91 through 105 (of 2,894 total)
abhas (9/11/2014)
Hi all,in addition above.
Hi,
put varchar datatype, why because actual data is like: Sorry for not mentioning earlier.
99.87%, 99.96%, 8.67%
and out put want as
99.8%
99.9%
8.6%
Thanks,
Abhas.
Even worst that I thought!
Why...
September 11, 2014 at 11:17 am
abhas (9/11/2014)
Hi All,Thanks for reply.
But is it possible search "." and select only one character after ".". because dataype is varchar here.
kindly help.
Thanks,
Abhas.
It is possible by plain stupid... Why...
September 11, 2014 at 7:13 am
jacksonandrew321 (9/11/2014)
Hi u can use asSELECT CAST(AVG(values) AS DECIMAL(10,1))
FROM tablename;
Thanks
Yep, or he could use:
SELECT CASE WHEN SUM(values * 1.234) + MAX(values)/64 > 1 THEN 'Good' ELSE...
September 11, 2014 at 6:48 am
Shadab Shah (9/11/2014)
I guess this might help
SELECT cast (round(11.63,1) as numeric(12,1))
/*Replace your column name instead 11.63*/
Have you tested it with just one value?
Try:
SELECT cast (round(11.67,1) as numeric(12,1))...
September 11, 2014 at 6:43 am
If you output to client, do it there.
If you need this values for futher use in SQL, you have multiple options.
Some here:
SELECT ROUND(val,1,1)
...
September 11, 2014 at 4:50 am
Eirikur Eiriksson (9/9/2014)
Alan.B (9/9/2014)
Cool. I never knew you could do that, very interesting :laugh:
Edit: sql code tag messed up...
September 10, 2014 at 6:39 am
Alan.B (9/9/2014)
Cool. I never knew you could do that, very interesting :laugh:
Edit: sql code tag messed up my "greater...
September 10, 2014 at 6:36 am
This is called "allocation issue".
You need to correct/adjust your calculated ratio so it will sum up to 100%
The simplest way is to chose which single item ratio you would want...
September 9, 2014 at 5:18 am
Yes, you could write the code so that it creates a single dynamic sql based code set that would import the data from the tables all at once...
Yep, building @sql...
July 3, 2014 at 11:26 am
hughesj23 (7/3/2014)
July 3, 2014 at 11:00 am
Pulivarthi Sasidhar (7/3/2014)
Use RIGHT and CharIndex and LEN function by converting/casting those fields as varchar and apply your logic....
Try converting FLOAT to VARCHAR and you will find that it is...
July 3, 2014 at 10:24 am
Not sure about the exists, but it doesn't look like a loop is needed at all...
As well as there is no need in transaction control over single insert statement...
Something tells...
July 3, 2014 at 10:04 am
The exact code you have posted is absolutely correct.
It might be something else in your real code which makes it fail.
Also, I would recommed to write such inserts with...
July 3, 2014 at 9:19 am
try to add
PRINT @dbuser_sql
Before executing it.
I guess you may need to change:
"LEFT OUTER JOIN ?." to "LEFT OUTER JOIN [?]."
July 3, 2014 at 9:01 am
Check this setup:
CREATE PROC usp_Test
AS
DECLARE @t TABLE (v int)
SELECT 1 [Val]
GO
Now lets test:
EXEC usp_Test
SELECT @@ROWCOUNT
Stored proc retunrs resultset with one...
July 3, 2014 at 8:41 am
Viewing 15 posts - 91 through 105 (of 2,894 total)