Query Filter Syntax for Today's Date in a Date Field

How to Filter Data in Dynamics 365 Finance

Question

You are employed as a Dynamics 365 Finance system administrator at your company.

You have been tasked with making sure that users are able to quickly reduce the number of records.

To do this, the data must be filtered according to specified criteria.

Which of the following is the appropriate query filter syntax for today's date in a date field? Which filter syntax should you use? To answer, select the appropriate options in the answer area.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.

https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/get-started/advanced-filtering-query-options
Advanced query syntax

syntax

value

‘value (exclamation point)

from-value.to-value
(double period)

Character
description

Equal to the value
that is entered

Not equal to the
value that is
entered

Between the two
values that are
separated by
double periods

Description

Type the value to
find,

Type an
exclamation point
and then the value
to exclude.

Type the from-
value, then two
periods, and then
the to-value.

Example

‘Smith finds *Smith’.

!Smith finds all value:
except "Smith.

1.10 finds all values
from 1 through 10.
However, in a string
field, A.C finds all
values that start with
“A” and "B", and valu:
that are exactly equal

To filter data in Dynamics 365 Finance, you can use the query filter syntax, which allows you to specify a set of criteria to filter records.

To filter records based on today's date in a date field, you can use the following filter syntax:

T(0)

This syntax uses the T function to represent the current date and time, and the (0) parameter to indicate that only the date portion should be used for filtering.

For example, if you want to filter the "SalesTable" table based on the "CreatedDateTime" field for records created today, you can use the following code:

SalesTable_ds = SalesTable_ds.where(SalesTable.CreatedDateTime == T(0));

This code filters the "SalesTable_ds" data source object to only include records where the "CreatedDateTime" field is equal to today's date.

In summary, option D, T(0), is the appropriate filter syntax to use for today's date in a date field in Dynamics 365 Finance.