I have a library with 65,000 items and for some items the “expiry date“ is not right. The field should actually be calculated automatically from the “creation date“ + 8 years. How can I determine the difference between creation date and “expiry date“ with a query so that I have only the relevant items in the array? Then change the value accordingly.
I did that already but so it doesn't work:
$spqQuery = New-Object Microsoft.SharePoint.SPQuery
$spqQuery.ViewAttributes = "Scope = 'Recursive'"
$spqQuery.RowLimit = $SPList.ItemCount
$spqQuery.Query = '<Where>
<And>
<Geq>
<FieldRef Name="Created" />
<Value Type="DateTime"></Value>
<FieldRef Name="Expire" />
<Value Type="dateTime"></Value>
</Geq>
</And>
</Where>'
$SPListItems = $SPList.GetItems($spqQuery)
foreach ($splistitem in $splistitems)
{
Mod Expire....
}
Who can help me a little further?
Regards, Dimatrix