Forum Replies Created

Viewing 15 posts - 4,081 through 4,095 (of 6,036 total)

  • RE: How to extract time portion of datetime along with AM or PM?

    Try to cut the code to calculate duration of some overnight event - started on one day and finished on another.

    Compare it with simple DATEDIFF.

    And don't put yourself in trouble.

    It's...

  • RE: Bankers Rounding

    > If you'd like to debate the accuracy of the function being used, that would be a wonderful direction to take, as I think everyone would benefit from a version...

  • RE: Bankers Rounding

    It's not a question of which representation I'd like to use.

    Bankers Rounding just cannot process 2/3 at all.

    What's a problem for you to show the code where you round 2/3...

  • RE: Bankers Rounding

    > Banker's rounding doesn't return "false results" any more than any other method of rounding or truncating a number, it returns perfectly predictable results which may or may not fit...

  • RE: Bankers Rounding

    I asked for code where BR function rounds 2/3.

    The only version I've got was rounding 0.66666666.

    But you claimed that 0.66666666 is 0.66666666(0) and not anything else.

    2/3 = 0.66666666(6), so...

  • RE: How to extract time portion of datetime along with AM or PM?

    BTW,

    you better don't separate date and time in tables.

    It's just wasting space, time for coding and losing performance of queries.

  • RE: How to extract time portion of datetime along with AM or PM?

    Actually 109, for example, brings you time portion.

    If you don't want to see date in the string just apply some string manipulations to remove unwanted characters.

    One of the options:

    SELECT STUFF(SUBSTRING(CONVERT(nvarchar(30),...

  • RE: Bankers Rounding

    So, class failed to provide code for bankers rounding of 2/3 and dismissed itself.

    On my post #102 in this topic I can conclude:

    Bankers Rounding either

    - cannot round most of...

  • RE: Bankers Rounding

    I would keep the kitchen table corners.

    Just in case: mother-in-law visit or something...

  • RE: How to extract time portion of datetime along with AM or PM?

    Open BOL on "CAST and CONVERT" and choose one of formats having AM/PM.

    108 is not the only one.

  • RE: Bankers Rounding

    > Just so you all know, there are definately more than 5 that have been reading this since the beginning.

    And some become quite exited about that.

  • RE: store proc

    elect distinct

    Case WHEN I.classid=4 then 'P'

    when I.classid=3 then 'R'

    when O.jobid=9 then 'U'

    end as EmployeeId,

    O.empname,

    U.classname

    from emp O

    left outer join Lookup T on O.TypeId = T.TypeId

    left outer join Indicator I on I.empid=...

  • RE: Bankers Rounding

    The result was for

    select @a = 100001

    select @b-2 = 800000

    select @d = @a / @b-2

    But it does not matter.

    Take @a = 100000.001, @a = 10000.05, etc., whatever.

    On any precision...

  • RE: Bankers Rounding

    Still waiting for a script rounding 2/3.

    Is it too hard for you?

    Probably you could ask SQL professional for a help?

  • RE: Bankers Rounding

    Here's myresults:

    closest dollar

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

    .0000

    closest 50 cents

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

    .0000

    closest 20 cents

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

    .2000

    closest...

Viewing 15 posts - 4,081 through 4,095 (of 6,036 total)