• it will be easy for people if you post the table defifntion (create stmt) along with some sampoled data plus expected output.people generally steal some time from their busy scehdules to help other people and often they dont have time to frame everything on theri own (and sometime people are too lazy like me which are reluctant to do this 😀 ) so better do these things to get the result faster. See link in my signature below

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)