Greetings!

I have this db containing this table:

CREATE TABLE LSOpenJobs
       (
id integer primary key, ProjID integer, subProjID integer, parent, children, login, cust, proj, PClass, PSubClass, bdate, ddate, edate, pm, pmuk, lang, vendor, vEmail, invoice, ProjFund, PMTime, A_No, wDir, BiliDir, TMDir, DeliveryDir, paid, paidDate, notes, status, pages, ta
       );

I am trying to make a report and I am calling this select statement,

select ProjID, cust, proj, bdate, ddate, edate, sum(invoice), sum(ProjFund)
 from LSOpenJobs where ProjID = 423 AND PClass!='Quote' group by ProjID;

There are more than one record where ProjID = 423 and PClass != "Quote". But when I run the program, I get,

DBIException: The name 'invoice' is not a valid index.

Previously, I had this select statement,

select ProjID, cust, proj, min(bdate), max(ddate), max(edate), sum(invoice), sum(ProjFund)
 from LSOpenJobs where ProjID = 423 AND PClass!='Quote' group by ProjID;

But I would get,

DBIException: The name 'bdate' is not a valid index.

So, here is what I would like to do:
1. Get the lowest date possible from bdate
2. Get the highest date possible from ddate
3. Get the highest date possible from edate
4. Add all the values in invoice
5. Add all the values in ProjFund
6. Group it by ProjID.

I guess I could do it one by one and use the program to do this, but I rather use SQLite functions and receive one record with all the values desired.

Any help would be greatly appreciated.

thanks,

josé

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to