Re: export expressions w zero in denominator

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Chrissy,

I'd tackle this sort of thing by explicitly handling the error
condition in the expression(s) in the query. e.g. instead of

[Numerator]/[Denominator]

I'd use this:

IIf([Denominator]<>0, [Numerator]/[Denominator], Null)


On Tue, 17 Jul 2007 16:04:03 -0700, chrissyb
<chrissyb@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi... it seems that Access is automatically deleting my expression values
that yield an undefined value (zero in the denominator) when I export to
Excel. I get a message that x number or records have been deleted. It
appears that there are now blank spaces in Excel where zeros and #Div/0! (or
#Value) were in Access.

Is this correct? Is this how Access handles exporting expressions with
undefined, zero in the denominator results? If so I'm ok with that as I have
to delete them eventually anyway. I just want to be sure this isn't messing
up my data and calculated expressions.

Also when I run a query with undefined values in it, I can get results.
However if I try to open that query at a later time I get one blank row of
data returned with a divide zero message. So, it seems useless to save
queries that have records of expressions with zero in the denominator. I
have to re-input the query time after time. Is this expected?



Please advise.
--
John Nurick - Access MVP
.



Relevant Pages

  • Re: Conditional printing of records in the detail section of a rep
    ... I got sick, still sick, so I'm putting this on hold for the moment. ... In query design, type an expression like ... sums the numbers from approximately 35 numerical fields ... The default data is zero. ...
    (microsoft.public.access.reports)
  • Re: Conditional printing of records in the detail section of a rep
    ... The query option, as outlined in your post, doesn't work. ... The default data is zero. ... commands used in the Event Procedure? ... unbound form with a command button to open the report filtered, ...
    (microsoft.public.access.reports)
  • Re: Does DateDiff Have A Bug
    ... a calculated field in a query is the way to go here. ... But here's why I added the DaysRemaining ... I'm trying to write the result of lngDays when it reaches zero days ...
    (microsoft.public.access.formscoding)
  • Re: Division by 0
    ... I am trying to create a query that has a calculated field. ... Is there anyway to check the denominator for zero before I perform ...
    (microsoft.public.access.queries)
  • Re: Sum Expression gives 1.45519152283669E-11 instead of 0 (zero)
    ... So, I gather, any time I want to omit zero records in query, I'll have to ... where TransactionQuantity and CreditDebit are Integers while CurrentPrice ... AssetHolding: ...
    (microsoft.public.access.queries)