9
votes

Apparently it is impossible to provide the Changed Date field with a timestamp (format '2009-12-14 10:00:00') when defining a new Team Query. I get the error: "The query failed. You cannot supply a time with the date when running a query using date precision.".

Is there a workaround for this? I just want a list of work items which are changed since the last 'x' minutes.

6

6 Answers

2
votes

You to enter the date in the same format as it is displayed by VSTS: dd-MMM-YY (01-Jan-16).

1
votes

In order to filter your items in TFS by a specific date, stick to this format: enter image description here

1
votes

try adding query parameter timePrecision:true. This worked for me

0
votes

I ran into the same problem while trying to query for the latest updates and worked around it by doing the following

// defined elsewhere
private DateTime lastUpdated;


string consult = "select * from WorkItem where [Created Date] > ' "  + lastUpdated.ToString("MM/dd/yy") + 
                    "' AND [Work Item Type] = 'Test Case'";

IEnumerable<ITestCase> tcc = testManagementTeamProject.TestCases.Query(consult).Where(tp => tp.DateCreated > lastUpdated);

I did something very similar for retrieving test results

0
votes

The last parameter of this query constructor lets you define the precision:

dayPrecision

When TRUE, indicates that a DateTime should resolve to an entire day. Often, it is TRUE to avoid being more precise about a specific time.