In our first query, we will try to retrieve the items that our customers buy per month. To do so, we will use the Item Ledger Entry table as our main data source, but we will also use the Customer and the Item tables to get additional information from customers and items, such as their name or description.
First, let's define the main data source and the fields that will be retrieved:
- Open the Object Designer window in the Microsoft Dynamics NAV Development Environment and select the Query object type on the left pane of the Object Designer window.
- Click on New to create a new query. An empty Query Designer window will open.
- On the first line, in the Type column, choose DataItem from the drop-down list: