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

Notifications

Announcements

No record found.

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
    629 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,255 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,664

#2
YUN ZHU Profile Picture

YUN ZHU 960 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans