You are viewing an obsolete version of the DU website which is no longer supported by the Administrators. Visit The New DU.
Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Reply #5: Here is my problem. [View All]

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
Hawkeye-X Donating Member (1000+ posts) Send PM | Profile | Ignore Tue Aug-17-04 01:08 PM
Response to Original message
5. Here is my problem.
I'm trying to covert the Excel code below to either
Expression Builder or SQL


Code:

=IF(SUM('CURRENT DMR'!F35)<>0,'CURRENT
DMR'!F35*8.34*'CURRENT DMR'!B35,"") 


Right now, 'CURRENT DMR'!F35 is equal to
[AvgInfluentBOD]![Expr1] and 'CURRENT DMR'!B35 is equal to
[AvgInfluent]![Expr1000]

This doesn't work when I try this code:

30daysBOD:
SELECT
IIf(Sum([AvgInfluentBOD]![Expr1])<>0,[AvgInfluentBOD]![Expr1]*8.34*[AvgInfluent]![Expr1000],"")
AS 30dayBOD;

An error comes out: 

You tried to execute a query that does not include the
specified expression" 'Iif(Not Sum(/)=0,
[AvgInfluentBOD]![Expr1]*8.34*[AvgInfluent]![Expr1000],
"")' as part of an aggregate function.

Some extra helps:

This is from AvgInfluentBOD: 
SELECT Avg([300I (Influent)]![BOD Lab mg/l]) AS Expr1,
Format(Date,"yyyy-mm") AS Expr2 
FROM [300I (Influent)] 
WHERE ((([300I (Influent)].Date) Between [Start Date] And [End
Date])) 
GROUP BY Format(Date,"yyyy-mm"); 

This is from AvgInfluent: 
SELECT Avg([Flow Data Calculations]![Influent Calc]),
Format(Date,"yyyy-mm") 
FROM [Flow Data Calculations] 
WHERE Date Between [Start Date] and [End Date] 
GROUP BY Format(Date,"yyyy-mm"); 

Hope this extra bit of info helps.


So any help would be greatly appreciated!

Hawkeye-X
Printer Friendly | Permalink |  | Top
 

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC