Thank you! I thought I was missing something....
you right, I used executesql anyway in case my question wont be
answered :-)
Thank you again for clearing this up!




On Apr 13, 4:08 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> DAL cannot do this. You need to use db.executesql("...."). sorry.
>
> On Apr 13, 5:06 am, canna <c.ne...@gmail.com> wrote:
>
> > Hello everybody!
>
> > I really need help with a query I'm trying to execute in Web2Py DAL
> > is there a way to use an inline table in the FROM field of a query?
>
> > this is my query:
>
> > SELECT SUM( HoursWorked / DayHoursSum ) AS DaysWorked
> > FROM `Tasks_TimeLog` H, (
>
> >   SELECT TheDate, User_id, SUM( HoursWorked ) AS DayHoursSum
> >   FROM `Tasks_TimeLog`
> >   GROUP BY TheDate, User_id
> > )S
> > WHERE H.User_id = S.User_id
> > AND H.TheDate = S.TheDate
> > AND Task='2'
> > GROUP BY Task
>
> > this is the inline table in Web2py:
>
> > inlineTable=db()._select(db.Tasks_TimeLog.TheDate,db.Tasks_TimeLog.User_id,db.Tasks_TimeLog.HoursWorked.sum(),groupby=db.Tasks_TimeLog.TheDate|
> > db.Tasks_TimeLog.User_id)
>
> > how do I use the inline table in my full query??
>
> > rows=db(db.Tasks_TimeLog.Task=='2'.....).select(.....,groupby=db.Tasks_TimeLog.Task)
>
> > Thanks to all the helpers!!

Reply via email to