Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can I Do an IF Statement In an Access Query?

Posted on 2013-10-23
3
Medium Priority
?
328 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

715 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