Can I Do an IF Statement In an Access Query?

I have attached an excel spreadsheet with current and expected results
using an IF statement in a Query in Microsoft Access 2007. I cannot figure out how to do what I think is a simple If statement in Access.
The A column table in Access has numeric and "blank" values in the rows.
In another access B column I would like to fill in the blank rows with the number zero and have any non-blank row in Column A fill in automatically. Is there a simple formula to do this?
Below is the formula I am trying to put together. Currently this formula just fills in the blank rows with zeros but DOES NOT fill in the other numbers.
Any help would be greatly appreciated.
Thank you
Rick

Expr1: IIf([Total Of Ext-Price6]," ",0,IIf([Total Of Ext-Price6],>0=[Total Of Ext-Price6]))
Access-Current-Expected-Results.xls
ES-ComponentsAsked:
Who is Participating?
 
mbizupConnect With a Mentor Commented:
Correction:


Expr1: IIf(Trim([Total Of Ext-Price6] & "")  = "",0, [Total Of Ext-Price6])
0
 
mbizupCommented:
Try this:

Expr1: IIf([Total Of Ext-Price6] = " ",0,[Total Of Ext-Price6])
0
 
ES-ComponentsAuthor Commented:
bmizup
You are the best!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thank you for that quick response. The second expression works PERFECT!!!
I would have never figured it out.

Thank you again.
Rick
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.