method for querying list data
7
votes
3answers
3k views
How to write CAML queries filtering on ModStat (Approved, Rejected) when using Language Packs?
When using content approval the CAML for retrieving (say) just Approved Items is
<Query>
<Where>
<Eq>
<FieldRef Name="_ModerationStatus" />
<Value ...
7
votes
1answer
1k views
Why is my CAML query working in CAML Builder but not in the application?
I have a CAML query that queries a calendar list and I want it to return all the items in the list with an EventDate of today or later, ordered in ascending order. The CAML query I'm using is this:
...
7
votes
4answers
743 views
CAML Now Instead of Today - CAML Bug?
I have a CAML query, in which the <Where> node looks like:
<Where>
<Leq>
<FieldRef Name='PublishedDate'/>
<Value Type='DateTime'>
<Today/>
...
7
votes
3answers
2k views
SharePoint 2010 CAML Query fails when indexed columns used
I have an SPQuery that has been working fine until my list hit 500 items:
q.Query = "<Where><Eq><FieldRef Name='DefectID' /><Value Type='Counter'>" + DefectID + ...
6
votes
2answers
2k views
Can I order by Content Type in a CAML query?
Is it possible to order by content type in a CAML query?
I seem to always get the same result no matter what I do with the Order by. Ordering by ID instead works perfectly.
query.Query = @"
...
6
votes
4answers
3k views
Where can I find a list of CAMLvariables and ServerVariables?
Having some trouble finding a list of these variables. Any help would be greatly appreciated.
More specifically, when I see this on the page:
<ParameterBinding Name="UserID" ...
6
votes
1answer
4k views
CAML query builder that supports inner joins?
I'm Looking for a query builder that can assist me in creating CAML queries that will contain inner joins.
Does anything like this exist?
Update: To ask my question more clearly, I am looking for a ...
6
votes
1answer
285 views
How to Combine IN-Opeator with LookupIds in a caml-query?
I want to build a CAML - Query using the IN - Tag. The queried Column is a lookup-field to a Title of another list. When I query using the text-property everything works fine:
<Where>
...
6
votes
1answer
3k views
CAML query for field of type “Person or Group” which allows multiple selections
Consider a list which has a column of type "Person or Group" (single selection) witch contains a SharePoint group. I want to return all rows for which the group is within a list. I know the IDs of the ...
5
votes
5answers
946 views
When I execute a CAML query, how do I know what ListItem details I can include?
I was querying a SharePoint library, trying to retrieve some file attributes. Apparently some things like FileType and Date are not supported, even though those fields are listed as a built in field. ...
5
votes
3answers
542 views
sharepoint caml is fast - how?
We all know that Caml is faster than using linq, since linq internally gets translated to caml.
But can anyone explain how caml is best to do sharepoint queries or how it is fast or what makes it ...
5
votes
3answers
2k views
Caml to get today's birthdays
I have a list with birthday field (DateTime).
How do I write caml query to retrieve only the records where birthday falls on today (i.e. only comparing day and month value of birthday column to ...
5
votes
2answers
4k views
CAML Query with Date Range
I'm writing an SPSiteDataQuery and I am having issues with the Query property. I need to return all results where the Record_x0020_Yr_x0020_End_x0020_Date is between 12/31 of the current year and 90 ...
5
votes
2answers
361 views
Get CAML from LINQ to SharePoint
Is there an equilivant to GetCommand in LINQ to SharePoint? I know about ctx.Log, but I'm looking for something to retrieve the CAML from a LINQ statement without executing it.
5
votes
1answer
1k views
Need help with CAML in CQWP
I tried to implement a CQWP web part that could show me all the checked-out files following this guide: ...
5
votes
2answers
716 views
Problem with CAML SPQuery ItemChildCount result
I know that this query works fine
SPQuery query = new SPQuery();
query.Query = "<OrderBy><FieldRef Name='ItemChildCount' Ascending='FALSE' /></OrderBy>";
But my ...
4
votes
4answers
4k views
CAML query not working
I have written following CAML query to Retrieve items which are due in 7 days, It doesn't seems to be working, Please let me know what I missed ?
string internalEndDate = web.Lists["List ...
4
votes
4answers
484 views
CAML query error when creating SPQuery query
I have this CAML query
var query = new SPQuery{
Query = string.Format(@"<Where>
<Or>
<Or>
<Or>
...
4
votes
3answers
3k views
How to build a CAML query with where clause
I have this CAML below and i'm tring to do something like this.
Where username ='username' and id = 'id'
<Query>
<Where>
<And>
<Eq>
...
4
votes
4answers
1k views
Help with CAML query
I have the following query but I am not sure if it does what I really want:
<Where>
<And>
<Contains
<FieldRef Name='Phase' />
<Value ...
4
votes
1answer
3k views
CAML query with more than multiple AND/OR generates SPException “One or more field types are not installed properly. Go to the list settings page to delete these fields.”
I need to build a CAML query at runtime based on user input. The CAML query could be as simple as
<Where>
<Eq>
<FieldRef Name="Status" />
<Value ...
4
votes
3answers
2k views
How to get last major published version?
I am trying find exact CAML query, or other possible way in code to find out
"The last major published version" (not necessarily the latest)?
4
votes
1answer
927 views
CAML: Filter URL field on description (not on URL)
I have a list with an URL-field. Nothing special, just the OOTB Hyperlink-field.
I want to execute a CAML-query that selects items with a certain value in the description part of the URL-field.
CAML
...
4
votes
2answers
374 views
CAML Query for items with a text value containing square brackets
I'm attempting to query for list items using a value stored in a plain text multi-line of text field in a SharePoint 2007 custom list.
My column is named FilePath and contains a value like: ...
4
votes
1answer
498 views
Problems with customizing Ribbon for webparts with “Summary Toolbar”
I have a problem with customizing Ribbon for webparts with "Summary Toolbar". I add the button through CAML code. (Generated by SPSF, but shouldn't matter)
My buttons shows up when viewing the list ...
3
votes
2answers
4k views
GetListItems Lists.asmx and Meta Data Columns
I'm trying to use the GetListItems web service in MOSS 2007 to return all the columns and rows in custom SharePoint list. I don't need to filter any of the data, so I've left the QueryOptions and ...
3
votes
2answers
779 views
CAML: Possible to query non existing field?
I'm using SPSiteDataQuery to fetch list contents from 2 different lists.
List A) has the fields CustomField and Title
List B) has only Title
Is it possible to build a (filter) query with ...
3
votes
1answer
2k views
How do I query a list using CAML and SPQuery?
I have a SPList but I don't need to go through everything in that list. I need to establish a CAML query so I can limit the list items. Then, go thru each item from the query result and do something. ...
3
votes
4answers
1k views
Best way to get CAML for a custom content type
I am trying to get the CAML for a custom content type that I am creating. What I am really doing is creating the content type in Visual Studio 2010 and then deploying that content type to my sandbox. ...
3
votes
2answers
3k views
Filtering items in a view using a CAML query
I'm having trouble querying SharePoint in such a way, as to combine a view results with my own CAML query inside a WCF service. It seems GetItems ignores my query, and just returns all the items in ...
3
votes
3answers
506 views
SharePoint 2010 equivalent to SQL Profiler?
Is there a way to view the CAML that is running on a SharePoint 2010 installation?
A bit like how you can monitor SQL running on a database with MS-SQL Server - is this possible with CAML and ...
3
votes
1answer
429 views
Using part of date in CAML query
I want to create new view for my list. The list contains a column called Year, which is a number and contains, as name suggests, year. Eg.:
2012
2011
2010
2009
I would like create a view, where I ...
3
votes
4answers
2k views
Not IN CAML Query
I have two Lists in SharePoint 2007
Clients
Actions
Actions list has a Lookup column called Client which takes its values from Clients List.
I want to display all those clients which are NOT ...
2
votes
2answers
3k views
CAML error: “One or more field types are not installed properly.”
I'm using the U2U CAML Query Builder tool and no matter what I do, I can't create a query. It keeps generating the error: One or more field types are not installed properly. Go to the list settings ...
2
votes
1answer
44 views
CAML Query where X =(A && B && C && D)
CAML makes me sad some days. Can someone point me in the right direction for the syntax in regards to a CAML query that would evaluate where X= A&B&C&D. My nesting is all off i'm assuming.
...
2
votes
4answers
633 views
where clause is ignored when query list
I have a CAML query which returns lists by a lookup field.
here is the query
<Query>
<Where>
<Eq>
<FieldRef ...
2
votes
2answers
189 views
Get SPQuery TotalItems from query
I want to get the total number of items that match my Query, BUT also limit the results.
So say I have 100 items in the list.
50 of the 100 items in the list match my query.
I want to only get 10 ...
2
votes
1answer
184 views
Should we use web service lists.asmx over CAML when working with large lists
There is a list that has around 100k items in a SharePoint Site Collection. This site has been customized to serve certain business requirements through visual webparts.
While, regular CRUD ...
2
votes
2answers
452 views
CAML query to retrieve the second set of three list items from the announcements list?
The CAML query to pull say 3 items based off of the following requirements seems pretty starightforward:
Title is not null
Expires(Expiry Date) is greater than or equal to Today
Order Created in ...
2
votes
2answers
3k views
Using Date offset in CAML query
In SharePoint 2010, Inned to get items from a list based on a condition. Considering one of the fields to be 'EventDate' of type DateTime, the condition is:
(EventDate - 60 Days) <= Today <= ...
2
votes
3answers
980 views
Caml query builder Office 365 Sharepoint Online
Does anyone knows where to find a CAML query builder that I can use for Office 365, Sharepoint Online?
(if there exists one)
2
votes
3answers
2k views
Querying for Approved (Published) List Item Data
My scenario:
I have a page layout that has a user control on it. This user control queries data contained in other pages within the site collection to show a summary of related information. Anonymous ...
2
votes
3answers
895 views
CAML Query Maximum Size
I am running a sharepoint caml query where I want to check that a field on an item is equal to one of many values. I do this dynamically and may wish to check against many hundreds of values.
I found ...
2
votes
1answer
4k views
SPService GetListItems with CAML : can't get example to work
enter code hereI am using an example I found on codeplex of SPServices with CamlQuery to try to get list item values with where clause on the ID. For whatever reason this doesn't seem to work for me; ...
2
votes
1answer
4k views
caml query to get listitem by Name field
I am trying to check if a filename exists in the 'Name' column of Shared Docs Library. I think only CAML could help here. So I made this query
"<Where><Eq><FieldRef Name='Name' ...
2
votes
2answers
598 views
How do I query several lists with the Object Model and merge the results?
Is it possible to with the Object Model query several lists at the same time and get the result merged together? Something like linked sources in SharePoint Designer?
I have created a web part that ...
2
votes
2answers
217 views
CAML Query behaving differently in CAML Builder and Code
Based on feedback from my earlier question, I have constructed a query using the excellent CAML Builder tool:
<Where>
<Or>
<Membership Type='CurrentUserGroups'>
<FieldRef ...
2
votes
1answer
439 views
Does an OrderBy CAML query return ONLY the most recent items?
var query = new SPQuery
{
Query = "<OrderBy><FieldRef Name="Created" Ascending="False" /></OrderBy>",
RowLimit = 100
};
Does this return the 100 most recently created items? ...
2
votes
1answer
2k views
CAML query recurrent events problem
Here is the code I use:
SPQuery query = new SPQuery();
query.ExpandRecurrence = true;
query.CalendarDate = new DateTime(2013, 1, 1);
query.Query = @"
<Where>
<DateRangesOverlap>
...
2
votes
2answers
269 views
Is there any guidance on designing lists for efficient CAML queries?
I'm designing some lists that may well contain thousands of items, and I'm trying to come up with the best design for efficient querying.
I'm looking for some form of (hopefully Microsoft) ...