public static void calcDataBetween(AssignmentFieldFunctor dataFunctor, SelectFrom clause, HasStartAndEnd generator, CalculatedValues values) {
if (generator != null)
clause.whereInRange(generator.getStart(),generator.getEnd()); // automatically also adds a generator to limit range
CalculatedValuesFunctor visitor = CalculatedValuesFunctor.getInstance(dataFunctor,values, (TimeIteratorGenerator)generator);
Query query = Query.getInstance();
query.selectFrom(clause);
if (generator != null && generator instanceof TimeIteratorGenerator) {
query.groupBy((TimeIteratorGenerator)generator)