CamlQuery Modified times

Sometimes you just needs items that have been updated in a certain period of time.
You can do this with a CamlQuery, in this example I’m looking for items that have been modified in the last 80 minutes;
Basically you generate a DateTime object and format it to the right format.
Also look at the ‘IncludeTimeValue’ option of the query…

 <View Scope='RecursiveAll'><Query><Where><Gt><FieldRef Name='Modified'/>
<Value  IncludeTimeValue='TRUE'  Type='DateTime'>" + datetime + "</Value></Gt></Where>><OrderBy><FieldRef Name='Modified' Ascending = 'true' /></OrderBy></Query></View>

Geef een reactie

Vul je gegevens in of klik op een icoon om in te loggen.

WordPress.com logo

Je reageert onder je WordPress.com account. Log uit /  Bijwerken )

Google photo

Je reageert onder je Google account. Log uit /  Bijwerken )

Twitter-afbeelding

Je reageert onder je Twitter account. Log uit /  Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit /  Bijwerken )

Verbinden met %s