Forum Replies Created

Viewing 15 posts - 271 through 285 (of 375 total)

  • RE: Bankers Rounding

    Thanks everybody for an educational and fun to watch discussion. I am not in the banking business but I will 'store' the functions provided in my 'treasure chest' because one...

  • RE: What am I missing?

    Try this example:

    DECLARE @dThird DECIMAL(12,6)

    DECLARE @d99 DECIMAL(12,6)

    DECLARE @fThird FLOAT

    DECLARE @f99 FLOAT

    SET @dThird = 0.33

    SET @fThird = 0.33

    SET @d99 = 3 * @dThird

    SET @f99 = 3 * @fThird

    SELECT @d99...

  • RE: Using the LIKE keyword with range values to specify the dash

    You may have problems with the trailing spaces if your MyField is CHAR datatype not VARCHAR. In this case try using RTRIM(MyField) LIKE '% %'.

    This should help. 

  • RE: find a column

    I found out that the routine provided by Aaron does not always return all the SPs where the specific column name is mentioned so you might want to try this....

  • RE: Ugly trigger code- ''''Arithmetic overflow error ....'''' with SUM()

    It looks like you don't use the Sum(IsNull(fd.synonymID, 0)) as drugID_count in the SELECT so I would remove it.

    Then you could try to replace the  having Sum(IsNull(fd.synonymID, 0)) = 0

    with having Sum(IsNull(CAST(CAST(fd.synonymID...

  • RE: What am I missing?

    PS.

    By the way, I do understand this is mostly an academic discussion because the selection of specific data types for storage and calculations depends on the particular case you...

  • RE: insert

    CREATE TABLE #tempdates

    (

    TempYear CHAR(4),

    TempMonth VARCHAR(15)

    )

    declare @year char(4)

    set @year = '2007'

    declare @dat datetime

    set @dat='1/1/'+@year +''

    declare @i int

    set @i=0

    while @i<=11

    begin

    INSERT INTO #tempdates

    (

    TempYear,

    TempMonth

    )

    select

    datepart(yy,@dat )as Year,DATENAME (...

  • RE: What am I missing?

    I am still not completely convinced. There is no way you could get the 1.000000000000000000000001 into a float. There is not enough precision. The float is very good at dealing...

  • RE: Help needed on concatination of data into variable problem

    Jeff, I think you misunderstood my post.

    The undocumented (and I don't think it is documented) feature is the usage of SELECT into varable when you do the query that processes...

  • RE: Help needed on concatination of data into variable problem

    COUNT

    If you inclined to scratch your left ear using your right hand going over top of your head.

     

    And funny part is that if...

  • RE: Syntax error converting the nvarchar value to a column of data type int.

    Sorry but I did not read your original post too carefully and did not realize your major objective was to make sure the index is used during your query.

    I kind...

  • RE: Syntax error converting the nvarchar value to a column of data type int.

    Try this

    SELECT

     a.Desc 

    FROM TableA

    INNER JOIN TableB ON b.field7 = CASE 

                                               WHEN ISNUMERIC(A.ID) = 1 THEN A.ID 

                                               ELSE NULL

                                               END

     

     

  • RE: What am I missing?

    I am sorry but I tend not to agree with Sergiy on the precision. Where did you get the 14 digits precision of the decimals? Look at the following code and...

  • RE: What am I missing?

    The trick we use to get the data the way we want is to do the calculations using the FLOAT but store the final ( or intermitent - if we...

  • RE: Can anyone think of a good reason for NOT having a PK?

    I don't know about any specific articles I could point you to. I think I kind of deducted this myself based on what I know about the way the server...

Viewing 15 posts - 271 through 285 (of 375 total)