1

So I am currently trying to pass the request formatted like this:

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <listName>000</listName>
      <viewName>000</viewName>
      <query><Query>
            <Where>
                <And>
                <Eq><FieldRef Name='Status'/><Value Type='Text'>Needs To Be Run</Value></Eq>
                <Geq><FieldRef Name='Created' /><Value Type="Date">2016-11-09 20:08:27</Value></Geq>
                </And>
                </Where>
            </Query></query>
      <viewFields></viewFields>
      <rowLimit>150</rowLimit>
      <QueryOptions></QueryOptions>
      <webID></webID>
    </GetListItems>
  </soap12:Body>
</soap12:Envelope>

But currently it seems to ignore the time of the created field query. It seems to work with date, but not time.

How do i specify the time properly so that it filters things that it only shows items that were created after a specific time?

4
  • are you tried <Value Type="Datetime"> Commented Nov 9, 2016 at 19:51
  • Yes. Datetime still does not seem to pass the time condition.
    – Bitz
    Commented Nov 9, 2016 at 19:54
  • try to set time like this 2016-11-09T20:08:27Z Commented Nov 9, 2016 at 19:57
  • Still no luck. Using <Geq><FieldRef Name='Created' /><Value Type='Datetime'>2016-11-09T23:08:27Z</Value></Geq> still returns the record with the create date: ows_Created='2016-11-09 11:07:46'
    – Bitz
    Commented Nov 9, 2016 at 20:03

1 Answer 1

1

Try to set the date time value with this format yyyy-MM-ddTHH:mm:ssZwith IncludeTimeValue='True' attribute , so it should like

<Geq><FieldRef Name='Created' /><Value Type="DateTime" IncludeTimeValue='True'>2016-11-09T20:08:27Z</Value></Geq>
3
  • It looks like that worked! Thank you! I had no idea there was a IncludeTimeValue Property for this method. Can you please post your source for this answer?
    – Bitz
    Commented Nov 9, 2016 at 20:12
  • I tried to use CAML Designer to test this you can download it from here blog.devoworx.net/2012/12/15/caml-designer , meanwhile, the source for this property is from Microsoft at msdn.microsoft.com/en-us/library/office/ms441886.aspx Commented Nov 9, 2016 at 20:16
  • This application is awesome. I was using "Postman" to send my XML and read XML manually before. Thanks again!
    – Bitz
    Commented Nov 9, 2016 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.