locked
Does ConditionOperator.OnOrBefore (FilterExpression) will consider time part while retrieving records using RetrieveMultiple RRS feed

  • Question

  • Does ConditionOperator.OnOrBefore (FilterExpression) will consider time part while retrieving records using RetrieveMultiple or will it consider just datepart.

    Thursday, March 13, 2014 5:47 AM

All replies

  • The value is on or before is a specified date.and does not take
    the TIME value.

    Some date operators do not exactly behave as expected, see Stunnware's
    article about that:
    http://www.stunnware.com/crm2/topic.aspx?id=FindingData2
    Anyway, you could always use the GreaterEqual operator to accomplish the
    same.


    Muhammad Sohail

    Thursday, March 13, 2014 9:12 AM
  • Hi Sohail thanks for your reply and one more question...,How to use GreaterEqual operator while retrieving data using retrievemultiple and having a date condition?
    • Edited by BONAM Thursday, March 13, 2014 10:31 AM
    Thursday, March 13, 2014 10:31 AM
  • Here is the code snippet from MSDN with Multiple conditions

    QueryExpression query = new QueryExpression("contact"); 
    query.ColumnSet.AddColumns("firstname", "lastname", "address1_city"); 
    
    query.Criteria = new FilterExpression(); 
    query.Criteria.AddCondition("address1_city", ConditionOperator.Equal, "Redmond"); 
    
    FilterExpression childFilter = query.Criteria.AddFilter(LogicalOperator.Or); 
    childFilter.AddCondition("lastname", ConditionOperator.Equal, "Tharpe"); 
    childFilter.AddCondition("lastname", ConditionOperator.Equal, "Brown");
    
    EntityCollection results = _serviceProxy.RetrieveMultiple(query);


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]

    Thursday, March 13, 2014 10:41 AM
  • Looks like we can go ahead with ConditionOperator.LessEqual

    Thursday, March 13, 2014 10:56 AM
  • ConditionExpression condition1 = new ConditionExpression();
    condition1.AttributeName = "new_reminder";
    condition1.Operator = ConditionOperator.GreaterEqual;
    condition1.Values = new object[] { "2007-07-26T10:46:44" };


    Muhammad Sohail

    Thursday, March 13, 2014 11:08 AM
  • Yes, ConditionOperator.LessEqual is possible.

    Here is the full list: http://msdn.microsoft.com/en-us/library/bb890525.aspx


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]

    Thursday, March 13, 2014 11:13 AM
  • Thanks Sohail / Eric
    Thursday, March 13, 2014 11:35 AM