Adding Values From Two Numeric Fields

S

SA2022VJG

I've created a database to track the required and elective training hours in
my office. Using a query, I want to add the two fields together to ensure
that each employee has met the training requirement for the period.

I've tried the following manually and using the expression builder with the
same results: nothing. Here is what I did: Using a blank column in the
query, I added the required and elective hours using the following
expression, which includes the exact field names from the table: Expr1:
Sum([Required Hours]+[Elective Hours]). The Total line in the query shows
"Group By" for all table fields and "Expression" for the calculated column.
When I run the query, no results appear for the expression.

I also created a report for this query and in the report used a text box to
add the Required Hours and Elective Hours fields down and across. When
previewing the report, I get the vertical totals for the fields in the table
(Required and Elective Hours); however, I get no vertical or horizontal
totals for Expr1. That is, if a course is made up of required and elective
hours, I want the report to show the required and elective hours in separate
columns and the total hours for that course in a third column. I also want
it to show the total required, elective, and total for the period (vertical).

I would appreciate any suggestions on what I am doing wrong.
 
D

Dale Fye

Chances are that one or both of the fields is NULL. Adding a number to NULL
returns a NULL. So try:

SUM(NZ([Required Hours], 0) + NZ([Elective Hours], 0)

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 

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

Top