Help with query

S

SF

Hi,

I have the following:

SELECT [2-2-3-e Result Set].Communes, [2-2-3-e Result Set].[FY 07], [2-2-3-e
Result Set].[FY 08], (nz([FY 08])-nz([FY 07]))/(nz([FY 07])+nz([FY 08])) AS
Percentage
FROM [2-2-3-e Result Set]
ORDER BY [2-2-3-e Result Set].Communes;


I received in the Percentage column an #ERROR when divided by 0, Is it
possible for me to eliminate the #ERROR and to only select those percentage
that is higher than 4%?

SF
 
D

David Glienna

Select only the data, and then use some code to put the valid records on the
screen. Just FY07 & FY08
 
J

John Spencer

Try the following

SELECT Communes, [FY 07],[FY 08]
, IIF(nz([FY 07])+nz([FY 08])>0, (nz([FY 08])-nz([FY 07]))/(nz([FY 07])+
nz([FY 08])),Null) AS Percentage
FROM [2-2-3-e Result Set]
WHERE IIF(nz([FY 07])+nz([FY 08])>0, (nz([FY 08])-nz([FY 07]))/(nz([FY 07])+
nz([FY 08])),Null) > .04
ORDER BY Communes;


John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top