# DataItemLink property on query data items
> Version: _Available from runtime version 1.0._
Specifies links between fields in a query data item and fields in one or more data items above it.
## Applies to
 Query data items
## Property value
`Field=AncestorDataItem.ReferenceField`
 Field is the name of the field in the table of the lower data item.
 AncestorDataItem is the name of an ancestor data item.
 ReferenceField is the name of a field in the table of the ancestor data item.
> NOTE
> You can link to more than one column. Separate multiple column links with a comma.
## Remarks
The DataItemLink property works with the devenv-sqljointype-property to combine records from tables into a dataset. It defines an equal-to (`=`) comparison between fields in the data item tables. The query combines records that have matching field values. Set DataItemLink on the lower data item in the query object.
> NOTE
> You can't set DataItemLink when SqlJoinType is set to CrossJoin. See Linking and joining data items to define the query dataset<../devenv-query-links-joins>.
> You can't use FlowField or FlowFilter fields in a query DataItemLink.
## Example
A Salesperson data item and a `Sales Header` data item contain the Code and `Salesperson Code` fields, respectively. To link the data items, set the DataItemLink property on the `Sales Header` data item.
```al
DataItemLink = "Salesperson Code" = Salesperson.Code;
```
## Related information
../devenv-query-object
devenv-sqljointype-property
devenv-dataitemlink-reports-property

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-dataitemlink-query-property, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-dataitemlink-query-property/
