Two Tables - Values from one in columns and other in rows w/ data from a third

  • I'm not sure why my other topic was removed (maybe too much code in the post) so I'll try again.

    I have two tables. We'll call them Subaccounts and AccountCategories.

    The Subaccounts table has just that - a list of Subaccounts and their descriptions (1 per row). See the attached file (Subaccounts tab).

    The AccountCategories table has a little more involved data. It contains a description (account category description) and a SQL-type clause that would be used to get data for that category. See attached file (AccountCategories tab).

    I'm trying to come up with a result like the Result tab in the attached file.

    The DATA would come from a third table by SQL statement (yet to be developed).

    How would I be best to go about creating this?

    Attachments:
    You must be logged in to view attached files.
  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • You may find that most people will be reluctant to open an Excel file from an unknown source. Could you take a look at Jeff Modem's excellent article on how to post: https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help

  • I have reviewed that in detail and will be re-posting shortly. Thanks for the tips.

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

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