Iif Is Null?

rbbakeriii

New Member
Joined
Jan 19, 2017
Messages
9
I am trying to create an AR Aging report in MS Access and I am having some issues with the If statement -- The [TERM_NET_DAYS] gives me the terms for the invoice (30, 60) but if the Invoice is COD, it returns a blank. So I am trying to make the [DUE_DATE] field = The [Invoice_Date] if blank

DUE_DATE: IIf(IsNull([dbo.RECEIVABLE].[TERMS_NET_DAYS]),[INVOICE_DATE],[INVOICE_DATE]+[dbo_RECEIVABLE].[TERMS_NET_DAYS])

I am getting the following error...

" is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long


I have no clue why that error is popping up, I thought it might be due to another field I have, but the Query runs fine if I remove it.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
How about just using the Nz function instead to convert the Null to zero, i.e.
Code:
[COLOR=#333333]DUE_DATE: [/COLOR][COLOR=#333333][INVOICE_DATE]+Nz([dbo_RECEIVABLE].[TERMS_NET_DAYS],0)[/COLOR]
 
Upvote 0
How about just using the Nz function instead to convert the Null to zero, i.e.
Code:
[COLOR=#333333]DUE_DATE: [/COLOR][COLOR=#333333][INVOICE_DATE]+Nz([dbo_RECEIVABLE].[TERMS_NET_DAYS],0)[/COLOR]

YOU ROCK! THANKS!

This forum is the best.
 
Upvote 0
I find Nulls to be messy to work with. Between formulas in queries and VBA, I can never remember if I want to use:
Code:
IsNull([Field])
[Field] is Null
[Field] = Null
And of course Nulls, Blanks, and Empty are not always treated the same.
So I just try to avoid them whenever I can.

And the Nz function really is a handy little tool...
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,570
Messages
6,173,126
Members
452,502
Latest member
perrygreen98

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