ACCESS: Query Formula

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,340
Office Version
  1. 365
Platform
  1. Windows
Using the Builder, I entered a new field in my query titled TOTAL

TOTAL: [START_UP_HOURS]+[HOURS_PER_MONTH]

Very simple formula, but it doesn't work. Any ideas Why??

I do have values in some of my rows for these two fields. But my Totals column is blank when I run my query.


Follow-up
I see whats happenening, it needs a value in both fields. So if Start up is 5 and Hours Per is blank the formula doesn't result in 5. Is there a way to get a value in my formula field even if one of the fields in the formula is blank?

Do I have to default all the fields to 0?
 
Last edited:

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Use the NZ function, which indicates what to use in placed of NULL values. Then all nulls in those fields will be treated like zeroes.
Code:
[COLOR=#333333]TOTAL: NZ([START_UP_HOURS],0)+NZ([HOURS_PER_MONTH],0)
[/COLOR]
 
Upvote 0
FYI for future - calculations involving Null result in Null. In your case, it must be that every record contains Null in one or both fields. It could be as simple as what you've encountered, or buried deep in an expression. Something to consider going forward whenever doing calculations.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,692
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top