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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Writing (SQL) queries?

(0) ShareShare
ReportReport
Posted on by 487

Hi Everyone,

I have reached another point of "how is this possible?!" in one of our projects

For a report, I need to create a join sql statement to get information from another table.

Explained:

I have a custom table with documents headers, that are linked to a customer. So far so good.

Now, for a report, I need to filter out those documents, based on the customer's country.

In a regular database setup, I would simply write an sql query with a join statement to get the country, and "where" on that.

Here, it seems simply impossible. What am I missing please?

Cheers

I have the same question (0)
  • Suggested answer
    Bilal Haider Profile Picture
    442 on at

    Hi John,

    As far as I understand this. It is possible in Business Central. While designing Report Dataset as per your requirement:

    Add customer table as first data item and then add your custom document header table as second data item and link both of these dataitems based on Customer No. The property that links two dataitems is called DataItemLink. On running report when you put filter on Customer dataitem based on country, only those documents will be generated that belonged to customers with that country code.

    Hopefully this will help you. Thanks

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,165 Moderator on at

    If your are running OnPrem and have database access you can write a SQL query. If you run SaaS then you need another way to report on your data. You could use PowerBI to create the report you need.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,005 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,148 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans