Excel > Access query problem

gbshahaq

Sham
Local time
Today, 17:49
Joined
Apr 21, 2004
Messages
52
I have an Excel sheet pulling data from an Access database, and this has been running happily for months.
Now I get a "division by zero [null] error message when pulling some of the data - looking at 1 specific access table.

If I open this in MS Query, it opens fine, but gives the error on "Return data to Excel". It also runs fine when I run the query in the database.

Any clue in the (simple) SQL?
Code:
SELECT q_MAIN_SAH.Adviser, q_MAIN_SAH.Month, q_MAIN_SAH.`%_SAH_Tgt_Achieved`, q_MAIN_SAH.MONTH_NUMBER

please help - this is driving me bananas - and i really want to avoid a copy-paste job!!!

Shammy
 
thanks for the reply Pat - but I did add this to the source query:

Code:
SELECT Advisers.Team, Advisers.Adviser, DATES.Month,q_tbl_03_SAH_CALLS.[SumOfCalls served] AS [SAH Calls Served], q_tbl_05_SAHORDERS.[SumOfSah orders taken], IIf((IsNull([SumOfPOT_SAHOrders]) Or [SumOfPOT_SAHOrders]=0),0,[SumOfPOT_SAHOrders]/[SumOfCalls served]) AS SAHConv_Target, q_POT_SAHCONV_SUM.SumOfPOT_SAHOrders, IIf((IsNull([SumOfSah orders taken]) Or [SumOfSah orders taken]=0),0,([SumOfSah orders taken]/[SumOfPOT_SAHOrders])) AS [%_SAH_Tgt_Achieved], DATES.MONTH_NUMBER

This doesn't explain tho to me why
a) the query has worked fine up to now (yes the database is growing in size)
b) query runs with no problems directly in MS Access AND in MS Query
 

Users who are viewing this thread

Back
Top Bottom