Skip to main content
deleted 2 characters in body; edited title
Source Link

CAML Query to find items with wrong expireexpiry date

I have a library with 65,000 items and for some items the expiration date“expiry date“ is not right. The field should actually be calculated automatically from the creation date“creation date“ + 8 years. How can I determine the difference between creation date and expiration date“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

CAML Query to find items with wrong expire date

I have a library with 65,000 items and for some items the expiration 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 expiration 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

CAML Query to find items with wrong expiry date

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

CAML QuryQuery to find items with wrong expire date

I have a library with 65,000 items and for some items the expiration 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 expiration 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.... }

$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

CAML Qury to find items with wrong expire date

I have a library with 65,000 items and for some items the expiration 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 expiration 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

CAML Query to find items with wrong expire date

I have a library with 65,000 items and for some items the expiration 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 expiration 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

added 240 characters in body
Source Link

I have a library with 65,000 items and for some items the expiration 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 expiration 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 = ""

$SPListItems = $SPList.GetItems($spqQuery)

foreach ($splistitem in $splistitems) { Mod Expire.... }$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

I have a library with 65,000 items and for some items the expiration 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 expiration 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 = ""

$SPListItems = $SPList.GetItems($spqQuery)

foreach ($splistitem in $splistitems) { Mod Expire.... }

Who can help me a little further?

Regards, Dimatrix

I have a library with 65,000 items and for some items the expiration 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 expiration 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

Source Link
Loading