query is null then field

eric.l.bohon

Board Regular
Joined
May 8, 2006
Messages
149
Good Morning to all,

Need help on a expression in a query.

I need to be able to get in a query if one field from a query is blank and the filed from a table is filled in then it shows the one that is filled.

here is the expression that I am using:

sum(IIf([qryTravel].[field] is null,([tblMonth].[field])))

the tblmonth has all the months in it with 0.00 dollars in it. when i have that query open it shows all the months with the data in it. but when i go in and put someones travel in then the data disappears.

Any help
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
You may also be able to use the NZ function, which you use to say what to use in the event that a certain field is NULL. The NZ argument has two arguments:

NZ(field to return, what to return if field to return is null)

Make sure that if you do use the IIF function, that you tell it what to use in the event that your condition is FALSE, or else your SUM may not work.

The IIF function has 3 arguments:

IIF(condition to check, what to return if true, what to return if false)
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

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