Solved

CAML query SharePoint 2007

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

I used to be SharePoint evangelist in our company, so my Outlook always full of questions about how to do this, or where I can find that. One day I found such an email with the following question: "how to attach 3-State workflow (one of the workflow…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

623 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