Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using an if statement for a null field in Access 97 1

Status
Not open for further replies.
May 5, 2005
39
US
Hi all, I tried to search for this and didn't get anything. I am sure I am searching wrong as I am certain this is a common question.

I am running this expression in my query and it is telling me the expression has invalid syntax. Does anyone know what I am doing wrong. I have not used Access expressions for a while now so I forget how to do this.

Thanks

Maturity Dt: (If [Maturity Date] IsNull, then [Estimated Maturity Date], else [Maturity Date])
 
Either:
Maturity Dt: IIf [Maturity Date] Is Null, [Estimated Maturity Date], [Maturity Date])

Or:
Maturity Dt: Nz([Maturity Date], [Estimated Maturity Date])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
For Access, I don't think the NZ will work. I have used the IIF construction and it has worked fine.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top