none
ChangedDate

    Question

  • When issuing a WIQL that has a Where clause that includes a condition for ChangedDate such as

    [System.ChangedDate] > '4/19/06 1:00 PM' the following error is returned "You cannot supply a time with the date when running a query using date precision. The error is caused by «[System.ChangedDate] > '4/19/06 1:00 PM'»." yet this Field is of DateTime precision. Any suggestions or answers to why this is occuring?

    Thursday, April 26, 2007 8:21 PM

Answers

  • How are you doing your query? 

    In order to supply dates in WIQL, you have to tell it to allow them.  It does not allow them by default.

     

    So you'd have to have code like this....

     

    Query qry = new Query(myworkitemstore, myquery, mycontext, false);

    ICancelableAsyncResult car = qry.BeginQuery();
      WorkItemCollection items = qry.EndQuery(car);

     

    Where the false tells it to allow times.  The parameter is called dayPrecision.  By default, it is true thus disallowing times for date/time columns in the WIQL.

    Thursday, April 26, 2007 9:30 PM

All replies

  • How are you doing your query? 

    In order to supply dates in WIQL, you have to tell it to allow them.  It does not allow them by default.

     

    So you'd have to have code like this....

     

    Query qry = new Query(myworkitemstore, myquery, mycontext, false);

    ICancelableAsyncResult car = qry.BeginQuery();
      WorkItemCollection items = qry.EndQuery(car);

     

    Where the false tells it to allow times.  The parameter is called dayPrecision.  By default, it is true thus disallowing times for date/time columns in the WIQL.

    Thursday, April 26, 2007 9:30 PM
  • That worked like a charm, Thanks!
    Wednesday, May 02, 2007 6:15 PM
  • Hehe, it's so cool when you find answers as quickly as this.

    I wonder why is it that this is disabled by default...

    Oscar
    Tuesday, July 24, 2007 4:55 PM
  • Mary, I can't find anyu sensible documentaiton on this on-line anywhere. What gives? What is mycontext? How is it used? And what doe true/false actually do in the fourth argument (dayPrecision)? Just ignore the time components in queries or respect them -  I am guessing Changed Date is stored at time resolution. And what's car and how can it be used (to cancel the query for example before it's done) and how does EndQuery work, is it blocking until the the query ends as one might presume, and if so where is the documentation on all this?.

     

    Cheers,

     

    Bernd.

     

     

     

    Monday, December 03, 2007 3:17 AM
  • Hi,

    I am getting the same issue in TFS Java API. Also, In java there is no way to pass parameters while creating query object.

    Any solution for the same ?

    Wednesday, May 23, 2012 1:00 PM
  • Hi

    I have set the parameter to false in query. still i am getting the same error. Even i tried running the query in the service. i got the same error. Any help please?

    Regards

    S.Keshaavan

    Tuesday, December 11, 2012 8:19 AM