Chart Pens Average Per Minute

Hi, so i have tags that record every one second the value sql. for the sake of the argument lets, name them.

Time/Blown preforms/Blown good bottles/ theorical bottle/

this is are total, like if they were odomerters. so they increase the time every one second and the rest whenever they actually blow a bottle or preform.

i would like to be able to chart Average per hour. if i use the easychart it just gives me and average for the total. so it is not good as my total is more than a million, i need a value that would give me a value per our. or even better per minute. which per minute should be around 150 bottles per minutes. so i need to be able to query the amout of bottles the i increase per minute and have the difference on every other minute. i think i might be able to do it from an sql Query, i was just hoping since this is with the tag historian that there might be an easire and faster way, so i don;t have to write different queries depending on the fact that i could want hours, or minutes in the results. any help appreciated.