views:

34

answers:

2

I want to use OrderBy in SPSiteDataQuery to sort items by data, however, the field containing the date differs between the content types.

Can this be solved by sorting with a calculated field? I am currently trying to create a calculated field that checks for existence of a field (using ISERROR), if it is found it returns the value, otherwise returns a default value. Or perhaps I can create a Calculated field in parent content type, then override it's formula and field references in a child content type - would such polymorphism work?

A: 

I don't know the answer to your specific question, but I think you're better off creating a custom field that grabs the correct value for each list item based on content type and then sort by that column. You'll probably get better performance results this way as well, since there will be fewer on the fly calculations.

Daniel
A: 

As I found out - NO, it can't.

skolima