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,437 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans