Solved

CAML query SharePoint 2007

Posted on 2013-10-29
2
421 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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