AnsweredAssumed Answered

Comparing Archive Values to Find Closest to a Discrete Time

Question asked by jorgewong on May 27, 2015
Latest reply on May 28, 2015 by jorgewong

I'm looking to write a C# function that would take the following inputs: tag name, start date range, end date range and a discrete date within that range.  The purpose is to find the closest archived value if one exists to the discrete date within the given range.  Getting the values for a range is the easy part but doing the comparison between the archives values if they exist gets pretty tricky.  Has anybody done something similar or know of a function within the SDK to possibly use to get what I need?  I'm currently looking at AFTime to set a discrete date first and then loop through a comparison against that from the archives values to try to get a difference.