Viewing 15 posts - 12,136 through 12,150 (of 13,469 total)
you need to post more specific details. the code i posted will do what you asked; so you are most likely not converting the final answer.
here's a more detailed example:
declare...
February 5, 2008 at 9:53 am
Mike Levan (2/5/2008)
when am doing thissum(convert(decimal(8,1),t.duration)/360000) as Duration
am getting
51.00000000
12.40000000
30.80000000
15.00000000
48.10000000
1.60000000
but i need only 1 decimal point
you divided the converted value by 360000.
you want the final result to be a decimal.
try
...
February 5, 2008 at 8:15 am
COALESCE would help you in this case...it's really just a CASE WHEN construct:
SELECT COALESCE(HOMEPHONE,CELLPHONE,EMERGENCYPHONE,'911')
FROM SOMETABLE.
it returns the first non-null item...so if homephone is null, it returns the cellphone, but...
February 5, 2008 at 7:47 am
you need to cast or convert the value that's in the field as a decimal.
declaration is size,number of decimals:
so SELECT CONVERT(DECIMAL(8,1),YOURCOLUMN FROM YOURTABLE wouold do what you ask.
example:
SELECT CONVERT(DECIMAL(8,1),23.00001)
,CONVERT(DECIMAL(8,1),12.9)
, CONVERT(DECIMAL(8,1),16)
,CONVERT(DECIMAL(8,1),14.567)
Results:
(No...
February 5, 2008 at 7:38 am
search for "DBA Toolkit" hereon SSC:
http://www.sqlservercentral.com/articles/Security/sql2000dbatoolkitpart1/2361/
It's got encryption/decryption, regular expressions and more.
January 31, 2008 at 5:42 pm
Interesting; I'd like to know how a PRINT statement affects the other procedures;I haven;t tripped over that yet, and do a lot of programming.
Can you explain what goes wrong?
Another idea:...
January 31, 2008 at 10:55 am
I've got a collection of functions like that that strip out certain characters, html encode data, etc, all based on Jeff Moden's Tally Table concept.
Try this out for size: it's...
January 31, 2008 at 8:49 am
don't forget the SQL DBA Toolkit here on SSC: it contains stored procedures to encrypt/decrypt data, as well as other goodies:
http://www.sqlservercentral.com/articles/Security/sql2000dbatoolkitpart1/2361/
January 31, 2008 at 8:11 am
In SQL 2000, you can use a trick to order the contents of a view; In 2005, you cannot use the trick anymore, because logically, the select statement should contain...
January 31, 2008 at 7:41 am
I was in a similar thread a while back, where there were really three different measures that we discussed:
max defined rowsize of the table
the actual max rowsize of...
January 30, 2008 at 11:12 am
well, you could insert it into a table, but I'm not sure that would help much.
the report has 48 lines of header information, that may or may not be a...
January 29, 2008 at 10:36 am
Jeremy's method is better; your statement will not catch an error if a space ro multiple spaces are entered...only an empty string; Jeremy catches null, empty string, and spaces...
January 29, 2008 at 10:25 am
what you are missing is an UPDATE FROM statement.
you can say UPDATE [sometable]
from [someothertable]
where sometable.id=someothertable.id
in your case, you know where the data is...you were able to select it as...
January 28, 2008 at 9:51 am
Christopher Taylor (1/25/2008)
ObjectID: NULL - looks like this is the problem!
hr: 0x80042727
Source: ODSOLE Extended Procedure
Description:...
January 28, 2008 at 6:36 am
Phil you just made me so happy;
I had previously bookmarked http://www.simple-talk.com/prettifier/default.php,
which is fine for formatting code for some things, but not for here at SSC.
the new link you posted at...
January 25, 2008 at 9:15 am
Viewing 15 posts - 12,136 through 12,150 (of 13,469 total)