p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

access thread: Grouping


Message #1 by pmcmillin@m... on Fri, 22 Jun 2001 14:20:33 -0500

I have a report that I designed for our regulatory reporting requirements 

and I am needing my query to group by two fields and still do sum 

totals.  Is this possible?



Here is my sql statement feeding the report.



SELECT tblProd_Data.txtLUW, tblProd_Data.txtCOMMFAC, 

tblProd_Data.txtPRODMO, tblProd_Data.txtPRODYR, tblProd_Data.txtWELLNAME, 

Sum(tblProd_Data.txtBEGOIL) AS SumOftxtBEGOIL, Sum(tblProd_Data.txtOILPRO) 

AS SumOftxtOILPRO, Sum(tblProd_Data.txtOILSLD) AS SumOftxtOILSLD, 

Sum(tblProd_Data.txtENDOIL) AS SumOftxtENDOIL, Sum(tblProd_Data.txtGASPRO) 

AS SumOftxtGASPRO, tblProd_Data.txtFldCode, tblFields.txtFldName



FROM tblFields RIGHT JOIN tblProd_Data ON tblFields.txtFldCode = 

tblProd_Data.txtFldCode



GROUP BY tblProd_Data.txtLUW, tblProd_Data.txtCOMMFAC, 

tblProd_Data.txtPRODMO, tblProd_Data.txtPRODYR, tblProd_Data.txtWELLNAME, 

tblProd_Data.txtFldCode, tblFields.txtFldName;



Now I need the combination of txtLUW and txtCOMMFAC to roll up and form one 

record.







Pam McMillin

Systems Technician



Schlumberger - IPM Asset Management

500 W. Texas, Suite 500

P.O. Box 2726

Midland, TX 79702-2726

Office 915/571-4600

Cell 915/556-0749

Fax 915/571-4788

pmcmillin@m...




  Return to Index