SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having some problems with the values getting returned for calculated and url fields when I query multiple lists with SPSiteDataQuery.

The values for these fields are no longer returned in the standard format. For a calculated field the value is a direct match instead of datatype;#value and for a url field only the url is returned, the description is missing.

It seems that as soon as I cut the query down to a only lists with a calculated field in them then the values are fine (all calculated fields are returned properly then, not just the ones in both lists).

The main problem is with the calculated fields, as SPFieldCalculated.GetFieldValueAsText throws an exception when the data type is missing - SPFieldUrlValue works fine.

Has anyone seen this behavior before?

share|improve this question

Yes there is a bug with the SPSiteDataQuery class. See the links below.

share|improve this answer
Hi Steve, Thanks for the reply, but in my case I see this effect when I query two lists. I will be redoing my development site in the next few days and will try and narrow down the problem to see if it is the same issue. Thanks again Calum – Anonymous May 10 '10 at 22:05

Hey Calum, Did you find a solution to this?

I am facing a similar issue when querying two different basetypes (Doc library and list) using the query. The results are retruned if I query them individually but the query fails the moment I mention the list IDs for the both the lists together in the list xml.

Thanks Gaurav

share|improve this answer
Hi Gaurav, I've been working on the client-side of my project for the last couple of months but need to sort this problem out inside the next 2-3 weeks before the deadline. I'll let you know as soon as I'm back on the case. Cheers Calum – Anonymous Aug 23 '10 at 17:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.