Share via


How to: Search for Dates in Work Items

Many dates are added to work item forms automatically. You can find work items that were changed on a given day or during a specific time period. Limiting the scope of a query also helps with performance by only returning those results that fit the date range that you want to include.

Required Permissions

To perform these procedures, you must be a member of the Readers group or have the View work items in this node permission set to Allow. For more information, see Team Foundation Server Permissions.

To search for work items modified today

  1. Insert a new row into a query.

  2. Complete the Field column by selecting a field that is a date field type.

    Note

    Most date fields contain the word "date" in the field name.

  3. In the Operator column, select = (Equal).

  4. In the Value column, add the date in one of the following ways:

    • Type the date   The date that you type must follow the format accepted by your computer's operating system.

    • Add Today's date   Select @Today from the drop-down list to pick today's date for the field.

      Note

      You can also modify this variable to search for the current date minus a number of days. For example, to find all items activated in the last week, you would set the Field column to Activated Date, the Operator column to >=, and the Value column to @Today - 7.

  5. Run the query.

To search for work items modified on a specific date

  1. Insert a new row into a query.

  2. Complete the Field column by selecting a field that contains a date.

    Note

    Most date fields contain the word "date" in the field name.

  3. In the Operator column, select = (Equal).

  4. In the Value column, type the date following the format accepted by your computer's operating system.

  5. Run the query.

To search for work items modified over a range of dates

  1. Insert a new row into a query.

  2. Complete the Field name column by selecting a field that contains a date.

    Note

    Most date fields contain the word "date" in the field name.

  3. For Operator, choose either > (Greater Than) if you only want items after the date, or >= (Greater Than or Equal To) if you want items that include the date that you select.

  4. In the Value column, enter the first date in the range of dates following the date format accepted by your computer's operating system.

  5. Insert another new row into the query.

  6. For And/Or, select And.

  7. For Operator, choose either < (Less Than) if you only want items before the date, or <= (Less Than or Equal To) if you want items that include the date that you select.

  8. In the Value column, enter the last date in the range of dates following the date format accepted by your computer's operating system.

  9. Run the query.

    Note

    You may need to group the two date rows for best results. For more information, see How to: Group or Ungroup Work Item Query Clauses.

See Also

Tasks

How to: Add or Remove Work Item Query Clauses

How to: Run Work Item Queries

How to: Group or Ungroup Work Item Query Clauses