Rounding to the nearest .50 ?

  • On a SQL Server 2000 database I have a table with with a field (datatype = float)

    The values are 1.00, 2.85, 1.5, 0.45 etc.

    The format I want for the previous data would be: 1.00, 3.00, 1.50, .50

    (Looking for .50 increments (the number is generated from a time field to represent hours and minutes))

    The StoredProc pulls the data as such

    snippet: CONVERT(DECIMAL(10,2),(ROUND(tp.parhrs, 2)))  AS dhrs

    What I get now is: 1.00, 2.85, 1.50, .45

    Does anyone know how to get to half hour increments?

     

  •  CONVERT(DECIMAL(10,2), ROUND(tp.parhrs*2, 0)/2 )  AS dhrs

    _____________
    Code for TallyGenerator

  • That works, Thanks!!!

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

You must be logged in to reply to this topic. Login to reply