473,385 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

IIF statement failure

In a query I have a calculated field that I want to look at field [FEE SCHEDULE]![OFF] and if it does not equal 0.00 return ([FEE SCHEDULE]![OFF] but if it equals 0.00 return [SC 85%]. I have it written as:

SC: IIf([FEE SCHEDULE]![OFF]<>"0.00",[FEE SCHEDULE]![OFF],IIf([FEE SCHEDULE]![OFF]="0.00",[SC 85%]))

But all I get is #ERROR. How should I be writing this to return the correct responses?

Thank you!
Apr 12 '07 #1
3 1304
Rabbit
12,516 Expert Mod 8TB
In a query I have a calculated field that I want to look at field [FEE SCHEDULE]![OFF] and if it does not equal 0.00 return ([FEE SCHEDULE]![OFF] but if it equals 0.00 return [SC 85%]. I have it written as:

SC: IIf([FEE SCHEDULE]![OFF]<>"0.00",[FEE SCHEDULE]![OFF],IIf([FEE SCHEDULE]![OFF]="0.00",[SC 85%]))

But all I get is #ERROR. How should I be writing this to return the correct responses?

Thank you!
1) Is [OFF] a numeric field? If it is then you don't need the quotes.

2) There is no need for the second IIF.

3) Is [SC 85%] a field?
Apr 12 '07 #2
1) Is [OFF] a numeric field? If it is then you don't need the quotes.

2) There is no need for the second IIF.

3) Is [SC 85%] a field?
Yes [OFF] is numeric and removing the quotes did the trick. I originally had it written as:

SC: IIf([FEE SCHEDULE]![OFF]="0.00",[SC 85%],[FEE SCHEDULE]![OFF])

but changed it to the other trying to make it work. I changed it back to this without the quotes and it worked great.

Thank you for the quick response!
Apr 12 '07 #3
Rabbit
12,516 Expert Mod 8TB
Not a problem.
Apr 12 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

94
by: John Bailo | last post by:
The c# *return* statement has been bothering me the past few months. I don't like the fact that you can have different code paths in a method and have multiple return statements. To me, it...
1
by: ms | last post by:
I am running an insert statement from a dbf file and there is one record causing the insert to fail. A msg. is returned stating it is due to an invalid datatype. There are 2 text fields, 2...
94
by: John Bailo | last post by:
The c# *return* statement has been bothering me the past few months. I don't like the fact that you can have different code paths in a method and have multiple return statements. To me, it...
20
by: John Salerno | last post by:
I'm starting out with this: try: if int(text) 0: return True else: self.error_message() return False except ValueError: self.error_message()
9
by: Jameson.Quinn | last post by:
I have: try: for line in open(myFileName): count += 1 except IOError: print "Can't open myfile" (I know, this is bad, I never close the file, but its just for illustration). But then I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.