• zulfansari (2/14/2014)


    Hello SQL Gurus,

    I have a table with three columns, Person, Date, Hours. I need to turn hours into 15 minutes interval.

    Can someone please help?

    Thank you,

    Here is what I have

    Person Date Hours

    101 02/01/2014 1.00

    101 02/02/2014 1.30

    It should be like

    Person Date Hours

    101 02/01/2014 0.15

    101 02/01/2014 0.30

    101 02/01/2014 0.45

    101 02/01/2014 1.00

    101 02/02/2014 0.15

    101 02/02/2014 0.30

    101 02/02/2014 0.45

    101 02/02/2014 1.00

    101 02/02/2014 1.15

    101 02/02/2014 1.30

    There's a bit of confusion in your original data. Are the decimal places minutes or decimal hours? You seem to indicate in your desired output that they're hours but I wanted to make sure.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)