473,651 Members | 2,790 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Complex IF Statement in a plain Access Query.

133 New Member
i have an complex IF statement, however, i am receving incorrect data when it becomes complex. the simple statement is
Expand|Select|Wrap|Line Numbers
  1. ContractStatus: IIf([Contract Status]="Pending Legal","Pending Waiver",[Contract Status])
  2.  
additionally, the field needs be to evaluated for "Signed, In file." if that is the case, the field will receive a value of "active contract." however, a -1 value is generated off of a text field. this was not generate when it was a simple IF statement. the code is as follows:

Expand|Select|Wrap|Line Numbers
  1. ContractStatus: IIf([Contract Status]="Pending Legal","Pending Waiver",[Contract Status]) Or IIf([Contract Status]="Signed, In file","Active Contract",[Contract Status])
  2.  
Any assistance would be appreciated.
Jun 8 '10 #1
2 2474
mseo
181 New Member
@dowlingm815
hi,
try this
Expand|Select|Wrap|Line Numbers
  1. ContractStatus: IIf([Contract Status]="Pending Legal","Pending Waiver",IIf([Contract Status]="Signed, In file","Active Contract",[Contract Status]))
Jun 8 '10 #2
dowlingm815
133 New Member
@mseo
did the trick...THANK YOU!
Jun 9 '10 #3

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

Similar topics

1
5730
by: Sreeneet | last post by:
Hi all, I want to call a stored procedure which is written in SQL Server from an ms-access query. It is having some parameters also and the stored procedure will return some records. Is there any way to do this? Any help?
2
1212
by: Dave Harrington | last post by:
Hi all - I got a pretty basic question that's been bugging me today. I'm using ASP.NET, C# and MS Access for a database driven application. I have a datagrid that will populate based on a registered user's access level. There are some instances where I'd like to use a basic OR statement in my Access query, but I do not know the syntax. The statement I'd like to use is below cmd = new OleDbCommand("Select * FROM
1
5145
by: ValeSyde | last post by:
Hi, I tried searching for this answer but I'm not even sure what to look for. I'll do my best to explain. I'm trying to create a query in Access. I have multiple WHERE conditions and depending on which WHERE condition returns true I want to return data froma specific column in the table. My database has columns named Date1, Time1, Option1, Date2, Time2, Option2, Date3, Time3, Option3, etc.. What I have so far:
12
5273
by: zwasdl | last post by:
Hi, I'm using MS Access to query against Oracle DB via ODBC. Is it possible to use HINT in Access? Thanks, Wei
19
17972
MSeda
by: MSeda | last post by:
I would like to use a Global variable as a criteria in an access query. in my first attempt to do so I wrote a Function that looks like this Public Function GloVar(ByVal VarName) As String GloVar = VarName End Function It Didn't Work.
3
7024
by: Idlemind23 | last post by:
Ahoy! I'm hoping for some help on what (I believe) should be a simple task. I have a form with a button. I would like that button to have a caption with a date. That date should be pulled out of a table when the form loads. (e.g. the button would read "Last Audit was 2006/12/21" - that date is on my "Audit" table). I created an actual query object to return the largest date on the Audit table. I'm trying to find a way in VBA to open...
6
3053
by: TSIGOS1 | last post by:
Hello, I have created a query in Access and I want to be able to read the sql statement of the query using vba and then run it from excel vba. That is instead of copying and pasting all the query sql statements i want to use code to read it directly from vba. Or alternatively run from excel the query on a recordset without the sql statement. Thank in advance Tsigos
2
8489
by: buddyr | last post by:
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"
6
4398
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one field between them. The join field in both tables are indexed and I'm selecting 1 field from each table to lookup. The Access query is taking more than 60 second to retrieve 1 record and if I execute the same query within the Query Analyzer, it...
17
19871
by: chadh | last post by:
Hello, I'm having some troubles exporting a query to a csv file. I am able to use the doCMD.TransferText to output the query to the csv file, however, I cannot get it to use the Export Specifications and on some queries data is showing up in what looks like HEX. Below is an example: SQL Statement for Invoice_Header Query: SELECT !! AS inv_id, !! AS tran_date, Sum(Item_Lot_Query.total_gross) AS total_gross FROM Item_Lot_Query; The SQL...
0
8357
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8277
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8803
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8700
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7298
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.