Page 1 of 1

Get max datetime column doing a froup by

Posted: Tue Oct 06, 2009 11:48 pm
by Credit_Inter
I have a job where I need to get the max(datetime_col) with a group by on group_by_col.

I used an aggregator where I gave the group by value as group_by_col and then the sort key as datetime_col.

The problem is that Aggregator only gives a double or a decimal output and not a datetime.

Thanks!

Re: Get max datetime column doing a froup by

Posted: Wed Oct 07, 2009 1:39 am
by robjones
In the Stage / Properties tab of the aggregator stage, under the 'Aggregations' category, try adding the property 'Preserve Type' to the 'Column for Calculation', and set it to 'True'.

This should force the stage to output the result of the aggregation in the datatype of the input column you are aggregating on.