Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Sql Union in AL?

Posted on by
Hi all,
 
I have this query. How can I achieve this in AL? . I don't want join, I want union. I need to use this in making a report and also in using the whole set of data to do some other validations.
 
SELECT ‘17’ As [Table No],[G_L Account No_],[Document No_],Amount
FROM [Company$G_L Entry]
UNION
SELECT ‘81’ As [Table No],[Account No_],[Document No_],[Amount (LCY)]
FROM [Company$Gen_ Journal Line]
 
Regards,
RomRyan
  • Samantha73 Profile Picture
    Samantha73 2,413 on at
    Sql Union in AL?
    A union in AL can be achieved via a temp table, but be aware that the performance could be compromised. Another alternative is to provide a PBI solution if this is only for reporting. 
  • Suggested answer
    Hein Kruger Profile Picture
    Hein Kruger 501 on at
    Sql Union in AL?
    Hi you can look into Flowfields. 
    Use the flowfield type lookup.
    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-flowfields

     

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.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,113 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans