web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Sql Union in AL?

(0) ShareShare
ReportReport
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
I have the same question (0)
  • Suggested answer
    Hein Kruger Profile Picture
    666 on at
    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

     
  • Samantha73 Profile Picture
    3,352 on at
    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. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 548 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 417 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 377 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans