Here's a code snippets in C#. The RemoveValues method basically removes archive values in the specified time range, for the last 2 hours below.
I think the only thing that you might want to take note of the the Data removal behaviour, there are 2 types of behaviour, "Remove All" and "Remove First only". "Remove All" deletes all value, whereas "Remove First only" remove the first value at the same time (when there is duplicate value).
PIPoint CDT158 = _Server.PIPoints["CDT158"];
PITime start = new PITime();
PITime end = new PITime();
start.LocalDate = end.LocalDate.AddHours(-2);
CDT158.Data.RemoveValues(start, end, DataRemovalConstants.drRemoveAll, null);