I'm not sure you can do that. In order to access the mysum column in the 
result, you would do:

row[mysum]

Anthony

On Sunday, February 26, 2012 11:05:59 AM UTC-5, Paul wrote:
>
> In the dal I'm selecting two summed fields and adding them together, 
> the column name in the set object ends up being called 
> '(SUM(t_appointment.miles_to) + SUM(t_appointment.miles_from))', how 
> would I define the dal query to get an better column name (e.g. 
> total_miles) ? 
>
> Current query is: 
>
>
> def mileage(): 
>     mysum = db.t_appointment.miles_to.sum() 
> +db.t_appointment.miles_from.sum() 
>     groupyyyymm = db.t_appointment.f_start_time.year()| 
> db.t_appointment.f_start_time.month() 
>     rows = db().select( 
>         mysum, 
>         db.t_appointment.f_start_time.year(), 
>         db.t_appointment.f_start_time.month(), 
>     groupby=groupyyyymm) 
>
>     return dict(rows=rows, sql = db._lastsql) 
>
>
> Thanks, 
>
> Paul 
>
>

Reply via email to