Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi,
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.
Solved! Go to Solution.
HI Kieron Hayes,
QueryNamedPropertyHistory has both StartDate and EndDate Parameter as input.
I think you can set the MaxItems as 1 and oldestFirst as false and endDate to get the last entry before a given time stamp.
HI Kieron Hayes,
QueryNamedPropertyHistory has both StartDate and EndDate Parameter as input.
I think you can set the MaxItems as 1 and oldestFirst as false and endDate to get the last entry before a given time stamp.
Hi Ankit,
thanks for your reply. You are correct, there are both start and end input parameters. Not sure why I thought there was only an end date .
Kieron