Use time aspect of DateTime in FetchXML filter RRS feed

  • Question

  • I'm trying to retrieve all records that have been modified since a certain time in a plugin. The following FetchXML appears correct when I can it being generated:

    <fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
      <entity name='account'>
        <attribute name='name' />
        <attribute name='address1_line1' />
        <attribute name='telephone1' />
        <attribute name='c20_update' />
        <attribute name='websiteurl' />
        <filter type='and'>
          <filter type='or'>
            <condition attribute='c20_update' operator='null' />
            <condition attribute='c20_update' operator='on-or-after' value='9/2/2014 4:30:00 PM' />
          <condition attribute='tickersymbol' operator='eq' value='ABC' />

    However it returns the following record (convert to an xml string for transport)

    <?xml version='1.0' encoding='UTF-8'?>
      <name>A. Datum Corporation (sample)</name>
      <address1_line1>2137 Birchwood Dr</address1_line1>
      <c20_update>9/2/2014 2:05:02 PM</c20_update>
      <address1_composite>2137 Birchwood Dr</address1_composite>

    I have tried with a custom date field and with the modifiedon field, but in both cases it seems to only account for the date aspect, not the time. Is there a better/correct way of handling this?

    Wednesday, September 3, 2014 12:36 PM


  • on-er-after only takes the date, not the time. Use 'gt'.
    • Proposed as answer by Guido PreiteMVP Wednesday, September 3, 2014 2:31 PM
    • Marked as answer by ChrisJC119 Wednesday, September 3, 2014 3:16 PM
    Wednesday, September 3, 2014 2:09 PM