AnsweredAssumed Answered

Urgent Help needed with DateDiff Function!

Question asked by NitinK on Feb 23, 2018
Latest reply on Feb 26, 2018 by rdavin



I know this may be more of a VBA question but I've received some great help from this forum in the past. I must preface this by saying that I'm not an expert with VB, but I can modify some existing code slightly. I work at a biomanufacturing facility where we use PI ProcessBook a lot for monitoring purposes. BatchView limits us to only view batches executed only in the same vessel. But we have multiple batches running in multiple vessel trains, so one of our control system engineers developed a BatchView like overlay tool for our group (manufacturing sciences - so no computer experts here!). This tool in ProcessBook is just like BatchView except it uses TagVal function to gather data from the PI Historian using an offset that is calculated using DateDiff. I recently realized that DateDiff doesn't account for DST differences. E.g. I tried to look at batch that was started in April of 2017, and my traces looked like they were offset by an hour. Whereas the traces of a batch started in February 2017 looked correct.


I'm on a mission to sort this out because this overlay template in ProcessBook has become an invaluable investigative tool for us.


Here's how the code is written now:



I would greatly appreciate any help in helping me figuring out a work around. Thank you all so much!