Using WS to query GetListItems with a greater than date and time query
-
11-12-2020 - |
문제
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?
해결책
Try to set the date time value with this format yyyy-MM-ddTHH:mm:ssZ
with IncludeTimeValue='True'
attribute , so it should like
<Geq><FieldRef Name='Created' /><Value Type="DateTime" IncludeTimeValue='True'>2016-11-09T20:08:27Z</Value></Geq>
제휴하지 않습니다 sharepoint.stackexchange