Solved

CAML query SharePoint 2007

Posted on 2013-10-29
2
416 Views
Last Modified: 2013-11-12
I have a list that has an "EventDate" column.  I want to be able to show items that are between the next 30 - 60 days.   I have the following query but not working correctly

<View><Query><Where><And><Geq><FieldRef Name="EventDate"/><Value Type="DateTime"><Today Offset="31"/></Value></Geq><Leq><FieldRef Name="EventDate"/><Value Type="DateTime"><Today Offset="60"/></Value></Leq></And></Where></Query></View>

Open in new window


Having the <And> returns nothing and the <Or> includes everything less than 60 and less than 30.

Any ideas?
0
Comment
Question by:Isaac
2 Comments
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 39610930
Hi,
sorry I have currently no 2007 system at hand, but could you try to adjust the attribute name "Offset" to "OffsetDays" like:
<View><Query><Where><And><Geq><FieldRef Name="EventDate"/><Value Type="DateTime"><Today OffsetDays="31"/></Value></Geq><Leq><FieldRef Name="EventDate"/><Value Type="DateTime"><Today OffsetDays="60"/></Value></Leq></And></Where></Query></View>

Open in new window


HTH
Rainer
0
 
LVL 5

Author Closing Comment

by:Isaac
ID: 39642254
Perfect!
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Work Over Net is a new and very powerful collaboration product. With its new easy interface it is becoming very competitive to other similar products like webex and office interactive. WON 2010 have the standard business tools needed for multi-offic…
If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question