Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

account for error or 0 values

Status
Not open for further replies.
Sep 25, 2002
159
US
Hi,

I have a query that divides two fields on the fly. The problem is that some of these values are throwing errors. One of the columns has this division: 0/2. When I try and create a pivot table from a query it throws an error.

Is there any way to account for these types of things in my query? These fields are updated daily so next week this 0/2 value might be a good value such as 24/7, etc....

thanks again
 
I figured it out. I used the IIF statement like this:

SELECT FirstQuarterData.WeekDates, IIf(FirstQuarterData.EUM_Week_Total=0,0,FirstQuarterData.EUM/FirstQuarterData.EUM_Week_Total) AS EUM_Weekly_Average.....

thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top