So I looked a little further into this, and DocumentCreatedWhen just won't work for my situation. I need to be able to pick the columns that are getting combined in the sorting criteria. For example, I created a test page and posted two press releases. One was posted Monday, and one on Wednesday. Then afterward, I created an Event which occurs on Wednesday. When I display these three items on my test page, I need the dates to appear in chronological order, but in the same list.
I came up with a trick to perform this effect in my query, by summing the two columns together. (ORDER BY EventDate + NewsReleaseDate DESC). However, This again won't work in the CMSRepeater. I receive the following error.
[DataConnection.ExecuteQuery]: Query: SELECT * FROM View_CMS_Tree_Joined_Versions INNER JOIN CONTENT_news ON View_CMS_Tree_Joined_Versions.DocumentForeignKeyValue = CONTENT_news.[NewsID] WHERE ((SiteName = N'county') AND (DocumentCulture = N'en-US')) AND (ClassName = 'CMS.News') ORDER BY (EventDate + NewsReleaseDate) DESC : caused exception: Invalid column name 'EventDate'.
Based on this, it looks to me like the repeater is constructing two separate queries (each with it's own join) and then it concatenates them together into one dataset manually. However, this seems unnecessary. The end result should be the same if it instead performed a single query with LEFT JOINS. In fact, because there is only one round-trip to disk, this should be quicker as well. For my purposes, I will use this query:
SELECT * FROM View_CMS_Tree_Joined
LEFT OUTER JOIN CONTENT_Event ON View_CMS_Tree_Joined.DocumentForeignKeyValue = CONTENT_Event.[eventID] AND ClassName = 'CMS.Event'
LEFT OUTER JOIN CONTENT_News ON View_CMS_Tree_Joined.DocumentForeignKeyValue = CONTENT_News.NewsID AND ClassName = 'CMS.News'
WHERE ClassName IN ('CMS.Event', 'CMS.News')
I will be using this query in an QueryRepeater to get past this limitation in the CMSRepeater. I would suggest that yout team considers modifying the CMSRepeater to work in this way as I believe it would be superior.