Solved

CAML query SharePoint 2007

Posted on 2013-10-29
2
414 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now