Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)

  • RE: How to trim the decimal places?

    I think that is because of your Decimal declaration. Try this one:-

    DECLARE @Num4 AS DECIMAL(30,10)

    SET @Num4 = 1567987.4699987

    SELECT LEFT(CONVERT(VARCHAR(100),@Num4),CHARINDEX('.',CONVERT(VARCHAR(100),@Num4))+2)

    I have changed @Num4 to DECIMAL(30,10) and is working fine.

    🙂

  • RE: How to trim the decimal places?

    DECLARE @Num4 AS DECIMAL(10,4)

    SET @Num4 = 1234.982644

    SELECT LEFT(CONVERT(VARCHAR(20),@Num4),CHARINDEX('.',CONVERT(VARCHAR(20),@Num4))+2)

  • RE: Query Elapsed Time

    Are you getting any error or something? I have tried the same code and it is working as expected. See the changed code:-

    declare @i int

    set @i=1

    DECLARE @StartTime DATETIME

    SET @StartTime =...

Viewing 3 posts - 1 through 3 (of 3 total)