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

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
    414 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,111 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

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

#2
YUN ZHU Profile Picture

YUN ZHU 658 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 595

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans