473,379 Members | 1,245 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,379 software developers and data experts.

more on iif statement question- need to add to criteria of query

107 100+
example:
field1 bblandscape, wallmart, kmart
field2 4,6,9
field3 5,7,6
field4 12,0,5
field5

if field2 > field3 then field5 = "Yes"
if field4 = 0 then field5 = "Yes"

can I add an if (iif) statement or switch statement to field5 in design view of a query and perform both these conditional statements together in some way. I am not writing the syntax right.
thank you

**** I RECIEVED THIS SOLUTION****
Try

field5: iif(field4 = 0, "Yes", iif(field2 > field3, "Yes", "No")

Now I want to be able to run the query and only show the records with "YES" in field5. I usually would put YES under field5 in criteria box in design view.
But its not working.
any ideas
Thank you
Apr 14 '08 #1
2 1335
Delerna
1,134 Expert 1GB
How about this
Expand|Select|Wrap|Line Numbers
  1. field5: iif(field4 = 0 or field2 > field3, "Yes","No")
  2.  
  3.  
Apr 14 '08 #2
buddyr
107 100+
thank you it works in my example.
Now I will take it to my database
Apr 14 '08 #3

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

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
1
by: M Wells | last post by:
Hi All, Further to my previous long-winded question about a situation in which we appear to be mysteriously losing data from our mssql2k server. We discovered an update statement, in the...
7
by: Tony Johansson | last post by:
Hello Experts! I have the following Array template class see below. I execute these three statements statement 1: Array<int> x(5); statement 2: cin >>x; statement 3: Array<int>::element_type ...
18
by: Eirik WS | last post by:
Is there a more efficient way of comparing a string to different words? I'm doing it this way: if(strcmp(farge, "kvit") == 0) peikar_til_glas_struktur->farge = KVIT; if(strcmp(farge, "raud") ==...
9
by: Michael | last post by:
Hi all, I would like to get people's opinion about executing SQL statements in C# (or any other .NET language really). I used to create my SQL statement by building a string and replacing single...
37
by: Ian Rastall | last post by:
I've been working on an online books site for almost four years now, and have been putting smart quotes in each book. This is a major hassle, and I'm beginning to think it's not worth it. Is...
8
by: Gordon | last post by:
Hi; I have designed a vb.net program that reads a dateTime value from a database table and then compares it to Now() through dateTime.compare(). I have loaded an array with my datetime values...
4
by: allenevaalleneva | last post by:
Q:Write a program that prints the numbers 1 to 4 on the same line with with each pair of adjacent numbers separated by one space. Do this several ways: a) Using one statement with one stream...
21
beacon
by: beacon | last post by:
Hello to everybody, I have a section on a form that has 10 questions, numbered 1-10, with 3 option buttons per question. Each of the option buttons have the same response (Yes, No, Don't know),...
10
by: JohnO | last post by:
Hi All, This question is related to iSeries V5R4 and db2. I want to implement an AFTER DELETE trigger to save the deleted rows to an archive table, I initially defined it as a FOR EACH...
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: 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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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.