Q:

Retrieve data from "FeedTrackedChange" table between particular time period

I want to retrieve data from "FeedTrackedChange" table between particular time period.
For Example:
select * from FeedTrackedChange where CreatedTime >= jan 2000

But the problem here is there is no timestamp field for "FeedTrackedChange"  table. I believe 'FeedItem' table is the parent table of FeedTrackedChange which is having 'CreatedDate' field. Can we create something like
select * from FeedTrackedChange where FeedTrackedChange.feeditemid in (select id from FeedItem where createdDate <= Starttime AND CreatedDate > Endtime)

Kindly help me here. Thanks in advance

A:

You can use SOQL to retrieve the FeedTrackedChange object but not directly. This means you need to query the FeedTrackedChange object via the parent feed object.
Lets say we want to focus on querying the FeedTrackedChanges from the AccountFeed and we are interested in the field which has been changed, its old and new values & the created date of the AccountFeed.
SELECT Id,
    (Select FieldName, OldValue, NewValue FROM FeedTrackedChanges),
    CreatedDate
FROM AccountFeed
WHERE (createdDate <= Starttime
AND CreatedDate > Endtime)

As you have mentioned, there is no way timestamp on the FeedTrackedChanges object but the CreatedDate on AccountFeed should be enough for what you need.

