Re: Summing values where one is #Error doesn't work

Tech-Archive recommends: Fix windows errors by optimizing your registry



You hero - I just needed to use Val instead of Clng... didn't even need the
IIF as it defaults to a NULL if it can't handle it. I've been scratching my
head over that for hours and you solved in 2 mins - THANKS!

"Dale Fye" <dale.fye@xxxxxxxxxx> wrote in message
news:A8779970-2179-41D9-BE0A-16EB2AEF73DA@xxxxxxxxxxxxxxxx
How are you converting the text to number?

You might try something like:

IIF(isnumeric([yourField]), Val([yourField]), NULL)

This would put a NULL in the numeric field if the data in that cell could
not be converted to a number, and would be ignored by the SUM( ) aggregate
function.

Dale

--
Email address is not valid.
Please reply to newsgroup only.


"will" wrote:

I have a raw_data table (originating from an external source and pasted
regularly into Access).
I have a normalised_query query based on raw_data and doing 'stuff'
including converting a text column to a number column. Where this
conversion fails (<1% of cases) the column in the query contains #Error.

I now want to run another query which includes a sum of that column, but
because the value #Error appears in one of the rows, the sum fails.

What's the simplest way around this?





.



Relevant Pages

  • RE: Calculated fields in main form based on criteria in sub form
    ... Main form (goat survey table and Total queries) ... NE Sum Query (uses information from the subform, ... other queries differ in what Quadrant equals) ...
    (microsoft.public.access.forms)
  • RE: Calculated fields in main form based on criteria in sub form
    ... Main form (goat survey table and Total queries) ... NE Sum Query (uses information from the subform, ... other queries differ in what Quadrant equals) ...
    (microsoft.public.access.forms)
  • Re: Report is making too many numbers
    ... from the $'s being listed more than once in the query. ... And you want to display the sum of in the Vendor header or footer ... My report is based on a query. ... those records--you could create a Totals query by depressing the ...
    (microsoft.public.access.reports)
  • Re: identify semi-duplicate records, and amend elements of those r
    ... Your idea was my first thought...so I relaxed that rule by allowing the Sum ... called OR how its used specifically within the query may have an impact? ... It could be that the Sum(HH CCY CFAMT) is not returning exactly ZERO. ... the select statement, and filled in specific criterion by criterion, to see ...
    (microsoft.public.access.queries)
  • Re: Date Range Totals for Logical Fields
    ... Query reformatted for ease of reading ... Lead Date Lead Date By Month Signed Up Sum Of Active Recruit Sum Of Info ... Recruits Kits Sent Recruits Contact Invites ... Then put your criteria there. ...
    (microsoft.public.access.queries)