Columns...

  • Hello

    I have a complex report to wrtie with a query which looks simple but isnt, my question is that each column has it own seperate query, how do i combine all such queries into one select query?

    Does anyone know....

  • Can't answer your question without seeing the query.

    😎

  • Hi,

    I hvae something similar but had a different dataset and graphs for different criteria. I have one query which calculates everything and insert into one table with type of criteria. I am inserting type into table so that i can differentiate into report.

    You can insert all data into one table and insert one more field as required by your column. Like column1, column2 etc for your record.

    When you get the data in RS at that time you get only one dataset but filter it according to your column value from table. You might need to create different dataset for different column. But it really depends on how your report looks like. It worked for me because i have 10 different criteria and showing details for each criteria.

    Just think about using filter into dataset from one table. So your sp should only cretae one table with all the data.

    i hope it helps.

  • Hi DVA2007

    Will the aggregate results be grouped by date in the new table, thats where my main problem is coming from, the need for the aggregated results to be group by date?

  • Hi,

    I need monthly data so i grouped by mm/yy. It really depends on what kind of data you have and do you really needs to group by date. Make sure you group by some specific format. otherwise if it is datetime format then it cant group by. As 12:13:23:00:00:33 and 12:13:23:00:22:01 is different.

    regards,

    vijay

  • Yeah it needs to be a daily aggregate to appear in the attached excel spread sheet format

  • had a mismatch when trying to create a temp table and the data were not cor-related.....

  • Step 1. Throw the original query as far away as possible.

    Step 2. Read the following article.

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    --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)

Viewing 8 posts - 1 through 7 (of 7 total)

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