Is it possible to create a query of queries without using UNION (1 Viewer)

Also you seem to have selected some fields twice, aliasing one. Why is that?
SQL:
...
  [Supplier #1 Name] AS ComponentLink4Description,
  [Supplier #1 Name],
  [Supplier #1 Part Number],
  [Supplier #1 URL] AS ComponentLink4URL,
  [Supplier #1 URL],
...
  [Supplier #2 URL] AS ComponentLink5URL,
  [Supplier #2 URL],
  [Supplier #3 Name] AS ComponentLink6Description,
  [Supplier #3 Name],
...

Well spotted. At the moment the query result is read by two different 3rd party applications. One of those applications requires fixed naming conventions but it is not read by the user. The second application requires it to be a user friendly name. The non-required field in both cases can be ignored by configuration in those applications.

However, it is confusing in both the query and applications so I intend to break it into two separate queries. One query for each application then I don't have to muck around with ignoring the unrequired respective fields.

Still learning...
 
Really should not use spaces nor punctuation (underscore only exception) in naming convention. Better would be SupplierNo3Name or SupplierNo3_Name.
 
OK, Many Thanks for helping out a newbie. As you say Access won't keep the formatting so maybe I'll edit and version control it through another editor. Cheers
It will if you are careful. For complex queries, I keep a table where I can paste the string so if I lose my mind and switch the actual query to QBE view and save it, I can recover. So, the trick is, if you want formatted SQL, you can NEVER switch to QBE view to modify or save it. Stay in SQL view and Access will maintain your format.

An alternate way to condense your string is to use an alias for the table name so you end up with t.MyFieldName rather than LongTableName.MyFieldName.
 
Really should not use spaces nor punctuation (underscore only exception) in naming convention. Better would be SupplierNo3Name or SupplierNo3_Name.
Yep, have just changed them all. I will have to use spaces in the Alias's though as these are what the user eventually sees in the 3rd party applications so want it to be nice readable.
 
I will have to use spaces in the Alias's though as these are what the user eventually sees in the 3rd party applications so want it to be nice readable.
That's fine. You don't program with those queries. And remember my tip about how to retain formatting of your SQL string if you want to work in SQL view.
 

Users who are viewing this thread

Back
Top Bottom