Help with query

  • Thread starter Thread starter SF
  • Start date Start date
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
 
Select only the data, and then use some code to put the valid records on the
screen. Just FY07 & FY08
 
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
 
Back
Top