views:

20

answers:

1

hi all,

I have to retrieve all the items from a list based on the condition that are modified in the last 1 month. I am using the following Caml query but its not working.

<Query>
<Where>
<Geq>
<FieldRef Name="Modified" />
<Value Type="DateTime">[Today-30Day(s)]</Value>
</Geq>
</Where>
</Query>

Please help me regarding this issue.

A: 

Have you tried the OffsetDays attribute?

<Query>
    <Where>
        <Geq>
            <FieldRef Name="Modified" />
            <Value Type="DateTime">
                <Today OffsetDays="-30" />
            </Value>
        </Geq>
    </Where>
</Query>
Faheem
thanks Faheemitian, it's working. But can u tell me the difference between your query and mine?
Abhimanyu
You were trying to use formula format. That format doesn't work with Value content. There are only certain elements that can be child to Value element or direct expressions. Read more here http://msdn.microsoft.com/en-us/library/ms441886.aspx
Faheem

related questions