• remove table/query aliases (2003)

    Author
    Topic
    #446664

    I have a database where some of the tables/queries in a query have been aliased. How do I remove the alias – or at the very least see through an alias to find out what it refers to – right clicking the table/queries in design view and selecting properties doesn’t give me this information ( the source field is blank), though I would have thought it should – certainly this article seems to suggest so?

    Viewing 0 reply threads
    Author
    Replies
    • #1086728

      The Source property is only used if the table resides in an external database.

      Open a query in design view.
      Select View | SQL

      Here is a simple example:

      SELECT Cat.strCategoryName, Prod.strProductName
      FROM tblCategories AS Cat INNER JOIN tblProducts AS Prod ON Cat.pkeyCategoryID = Prod.fkeyCategoryID;

      The query is based on two tables whose “real” names are tblCategories and tblProducts. Their aliases are Cat and Prod. As you see, the keyword AS is used to specify the alias.

      To get rid of the aliases, you’d have to edit the SQL strings, taking care to replace the alias with the original name in expressions such as Cat.strCategoryName.

      • #1086731

        Brilliant – thanks for that. ( I won’t be re-editing the SQL – It was already making my eyes glaze over!!!) cheers

    Viewing 0 reply threads
    Reply To: remove table/query aliases (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: