On Thursday 20 May 2010 4:56:40 pm Carey Gagnon wrote:
> I'm Back!!!
>
> Thank to all the help full information I've got a simpler method to get the
> info I want for my reports.
> The following works like a charm with one exception:
>
> I my apps db directory I have the following file getTimeSummaryDataset.py
> which id called by the FrmReportTimeSummary.py file in the ui directory
> and it looks like this:
>
> <code>
>
> #-*- coding: utf-8 -*-
>
> import datetime
> import decimal
> import dabo
>
> def getTimeSummaryDataSet():
>
> import sqlite3
>
> conn=sqlite3.connect('/home/theedo/Programs/Dabo/2010-timeEditionBackup.edb
>') crs = conn.cursor()
> crs.execute("select customerID, projectID,
> sum(strftime('%s',toTime)-strftime('%s',fromTime)) from records GROUP BY
> customerID,projectID")
> ds = []
> for cust in crs.fetchall():
> dsentry = {'customerID':cust[0], 'projectID': cust[1],
> 'durationtotal': cust[2],}
> ds.append(dsentry)
> return ds
>
> </code>
>
> The only issue now is, how do I do joins in sqlite as I have in my bizobjs
> file so that I can use customer.name (customer table) and
> project.name(project table) instead of just the customerID and
> projectID that are
> available in the records table.
>
>
> Anyone? Bueler?
>
> Thanks in advance
> Carey
sqlite> select
customer.name as custName ,
project.name projName,
d.duration
from customer,project,(select customerID, projectID,
sum(strftime('%s',endTime)-strftime('%s',startTime)) as duration from records
GROUP BY customerID,projectID) as d
where d.customerID=customer.id and d.projectID=project.id;
custName|projName|duration
adrian|dabo|22014
--
Adrian Klaver
[email protected]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]