Sitecore Rocks: Querying content added or updated after a date


This will be a very short post but felt like these queries may be useful to others who may be getting started with Sitecore Rocks. Basically the concept of the Sitecore Rocks queries below are to report on any content changes after a certain date. In the example, I'm using February 1st, 2016. 

First, let's get the total count of all items updated after Feb 1, 2016 *
select count() from /sitecore/media library//*[@__Updated >= '20160201T000000' OR @__Created >= '20160201T000000']
select count() from /sitecore/content//*[@__Updated >= '20160201T000000' OR @__Created >= '20160201T000000']
Next, grab the item information for those that have been added or updated:
select @@name as Name, @@id as Id, @@templatename as TemplateName, @@path as Path from /sitecore/media library//*[@__Updated >= '20160201T000000' OR @__Created >= '20160201T000000'] order by Path asc 
select @@name as Name, @@id as Id, @@templatename as TemplateName, @@path as Path from /sitecore/content//*[@__Updated >= '20160201T000000' OR @__Created >= '20160201T000000'] order by Path asc

Nothing earth-shattering here, but I like to provide Sitecore Rocks queries to the community when I feel someone else may find helpful.

Comments