Notifications
Announcements
No record found.
Hi all,
just need some advice, if we create new query, and I want to have multiple table (same level). Does these table should be on same structure, I mean the field name for each tables used.
Or I should create Map first so that the fields naming only 1 for each tables.
Thanks,
Hi WWwong,
What is your requirement? If you want to use Union between tables, you can change "Query type" property on the query to Union.
Hi Sergei,
No, I'm creating query through AOT, not X++
The requirement is create a report contain a group of tables (which may different fields) , listing some of the fields from that tables.
So plan is to create this query and use it in the report
Thanks
My bad, I found the property, now changing to "Union"
but when I use it in the report, when select Query, it says the query is not valid.
All I did in that query was just :
1. add table, select few fields
2. add another table, select few fields
There is Range on each of the tables, but I guess it is not the cause of the error.
That's all
"Query type" is set up in AOT for query created in AOT.
But it's still not clear. If you want to bring additional information to the main table - it's join case. For example, you have Customer transaction and you want to add Customer name from Customer table. But if you want to show all transactions for certain party (which can be Customer and Vendor) you can use Union and combine different tables to the one view.
The query has always one main data source. If you want many independent "main" data sources, just create many queries and execute them after each other. Not sure why you would want to do that, though. But this way you can first get some customers, then items, then currencies. Perhaps I don't understand what you want to do. Could you explain your actual business requirement?
If you need this "multiple queries" approach in a report, make the report use tmp table as data source and populate the tmp table from your multiple queries.
Hi,
The purpose of this report is just to combine multiple tables because actually it contain similar information (but unfortunately those tables structure is not identical).
Anyway found Microsoft docs about this, and clearly it is says for Union, the table structure need to be identic.
https://docs.microsoft.com/en-us/dynamicsax-2012/developer/how-to-combine-data-sources-in-a-union-query
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 592 Most Valuable Professional
André Arnaud de Cal... 478 Super User 2025 Season 2
BillurSamdancioglu 305 Most Valuable Professional