• I think you lost me here:

    Here I am trying to achieve the same without storing data in temp./staging tables.

    First I am creating a temp. table wih 2 rows

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."