Ordering of tables based on data output...possible?

  • As the title really.

    Can you order the tables depending on output? We have a support team and ideally the analyst with the least number of calls needs to have their table at the top of the output when it is run and then in ascending order with the analyst with the most calls at the bottom. Each analyst has their data in a table due to the type of information that is required.

    Many thanks in advance I have looked this up but nothing is exactly what I need it to do.

  • I am having trouble visualizing what you are asking.

    Can you put all the tables into a single dataset using union operators between each one, then group and sort the result?

  • do you have a userId/name that is inherited fromt eh page you can use as a parameter? then you can order the data:

    ORDER BY

    CASE

    WHEN SomeTable.AnalystID = @ThisAnalystID

    THEN 1

    ELSE 2

    END,

    OtherColumnsToSort

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks both!

    Daniel I went with your option, that has worked a treat!

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

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