Summing Memo Fields

  • Thread starter Thread starter Steve Welman
  • Start date Start date
S

Steve Welman

Hi

I a busy with a report, in the report I have 2 memo fields which, for the
records I have selcted via a query, contain values.

I am trying to sum these fields but an unable to do so, can anyone help me
with a worlaround to do this.

Thanks in advance.

Steve
 
Steve Welman said:
Hi

I a busy with a report, in the report I have 2 memo fields which, for the
records I have selcted via a query, contain values.

I am trying to sum these fields but an unable to do so, can anyone help me
with a worlaround to do this.

Thanks in advance.

Steve


If there is a requirement to sum the data then it would be better to
re-design the database to store the values in a more appropriate field. If
you really have no choice, then you will need to create a query. In the
example below, I am expecting to find whole numbers in the field and the sum
will be a whole number. Any non-numeric values will be converted to zero
and any decimal bits will be chopped off. If the values are not whole
numbers, use CSng or CDbl instead of CLng.


SELECT MyID,
Sum(IIf(IsNumeric([MyMemo]),CLng([MyMemo]),0)) AS MySum
FROM MyTable
GROUP BY MyID
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top