2 Replies Latest reply on Jun 8, 2017 8:21 AM by khayes RSS
    khayes Explorer

    How to get the last logged entry prior to a given time


    I have a service that takes an event time stamp as the input. In the service I want to get the logged value, for a particular property, at that time. The property is logged in a value stream

    To do this I need to retrieve the last logged entry prior to the time  stamp I pass in as an input parameter. Currently I use QueryNamedPropertyHistory service using the input time stamp as the end date parameter for the query. This works for now while there aren't many entries in the log. The problem will come when the log has thousands of entries.


    Unfortunately QueryNamedPropertyHistory only has an end date parameter. If there was a start date parameter I could use my time stamp as the startDate and some date further in the past as the endDate, so it would search backwards. It seems like there ought to be a simple way to get the last entry before a given time stamp.


    Does anyone have any ideas?

    Thanks in advance.