Solved

Can I Do an IF Statement In an Access Query?

Posted on 2013-10-23
3
316 Views
Last Modified: 2013-10-23
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
0
Comment
Question by:ES-Components
  • 2
3 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39594193
Try this:

Expr1: IIf([Total Of Ext-Price6] = " ",0,[Total Of Ext-Price6])
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39594206
Correction:


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

Author Closing Comment

by:ES-Components
ID: 39594346
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

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question