Forum Replies Created

Viewing 15 posts - 61 through 75 (of 87 total)

  • RE: Is it possible to build a dynamic temp table?

    @@SPID seems to work just fine. I've appended the @@spid value to the ##temp table name for each user. I plan to drop the tables after using them...

  • RE: Is it possible to build a dynamic temp table?

    Unfortunately, I can't use global temp tables because there could be many instances running at the same time, via VB and ASP. (I should have mentioned that in my...

  • RE: Suppress Trailing Zeros?

    Another oddity. How you view the results affects the test.

    Try using PRINT vs SELECT to view the output when casting as FLOAT:

    Declare @val Decimal(18,10)

    SET

  • RE: Concatenating Multiple Rows

    Thanks for the reply Paul. I'll look into the table variable as soon as we upgrade to sql 2000...Right now we're on SQL 7 though, so I think I'm...

  • RE: Suppress Trailing Zeros?

    FLOAT also gets ugly, both in output and in accuracy, with really small numbers:

    Declare @t as Decimal (18,12)

    set @t = .0000000009

    SELECT cast (@t as float)

    Result:

    -----------------------------------------------------

    8.9999999999999999E-10

    (1 row(s) affected)

    Also as Antares...

  • RE: Suppress Trailing Zeros?

    Thanks again to all of you. I was leaning toward explicit declaration anyway, but with this strong, unanimous endorsement I'll do it for sure. I always harp on...

  • RE: Suppress Trailing Zeros?

    Thanks again Antares, and Thanks David.

    I combined these two ideas to get:

    SELECT

    REPLACE(RTRIM(REPLACE(REPLACE(RTRIM(REPLACE(ADJ_VALUE,'0',' ')),' ','0'),'.',' ')),' ','.') As Adj_Val

    This single line of code does exactly what I want! The first...

  • RE: Suppress Trailing Zeros?

    One other thing,

    I added an extra character to the Varchars for the decimal (.). I changed all Varchar(18) to Varchar(19).

  • RE: Suppress Trailing Zeros?

    Thanks Greg,

    After looking at Antares' example I had begun to play with REVERSE. That's it. I made one tweak to yours though. Since there are 10 digits,...

  • RE: Suppress Trailing Zeros?

    Thanks Scorpion 66.

    It's good to get validation that I'm barking up the right tree here. I sure did try to get it to work with WHILE, but...

  • RE: Suppress Trailing Zeros?

    An off-topic side note. I tried using the code /code identifiers when pasting my code. Everything looks nicer in the web page but it doesn't cut and paste...

  • RE: Suppress Trailing Zeros?

    OK, here's what I did. I had trouble using WHILE inside the select query...used CASE instead) I know that there are up to 10 0s past the decimal...

  • RE: Suppress Trailing Zeros?

    Much of the data is quite small in value, so that wouldn't work for me. the .0016500000 would become 0.0. I need to keep all of the non-zero...

  • RE: Emulate FIRST aggregate function with T-SQL?

    Thanks, Jorg, for that tip. The sql looks more maintainable than the sub-join method to me. How do you find it does performance wise compared to the self-join...

  • RE: Emulate FIRST aggregate function with T-SQL?

    Ok, to make things more complicated, the following code creates the 'grades' table. I've modified the original data and added a comment column. What I'd like to get...

Viewing 15 posts - 61 through 75 (of 87 total)