Forum Replies Created

Viewing 15 posts - 12,136 through 12,150 (of 13,469 total)

  • RE: time field

    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...

  • RE: time field

    Mike Levan (2/5/2008)


    when am doing this

    sum(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

    ...

  • RE: How to return one of several values

    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...

  • RE: time field

    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...

  • RE: replacing multiple characters in a column

    search for "DBA Toolkit" hereon SSC:

    http://www.sqlservercentral.com/articles/Security/sql2000dbatoolkitpart1/2361/

    It's got encryption/decryption, regular expressions and more.

  • RE: Disable print in a stored procedure - TSQL - Example: Print 'This is my result'

    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:...

  • RE: replacing multiple characters in a column

    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...

  • RE: help needed with stored proc....

    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/

  • RE: Need to sort a view

    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...

  • RE: Total columns in a table

    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...

  • RE: Can this messed up text file be loaded into a table w/o using a Parser.

    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...

  • RE: How can I catch a blank column value on SP input?

    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...

  • RE: help in updating

    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...

  • RE: Convert RTF data

    Christopher Taylor (1/25/2008)


    i've thrown a bit of error handling in (after 1st sp_OASetProperty) and this is the output:

    ObjectID: NULL - looks like this is the problem!

    hr: 0x80042727

    Source: ODSOLE Extended Procedure

    Description:...

  • RE: If Then logic

    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...

Viewing 15 posts - 12,136 through 12,150 (of 13,469 total)