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.