473,385 Members | 1,465 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.

Expression

4
I am trying to write an expression and having trouble. I get the first part of my arguments correct but when I try to add the third I run into trouble. Here is the first part of the expression:
Expand|Select|Wrap|Line Numbers
  1. =IIf([completedate]>"",
  2.    "Complete",
  3.    IIf(
  4.       IsNull([CompleteDate]) And ([DueDate]<Date()),
  5.       "Overdue",
  6.       ""
  7.    )
  8. )
This works correctly. When I try and add the last bit it does not work. Here is what I am trying to add

IIf([ReviewDate]<= Date(),"In Process","")

Can anyone help me.
Apr 1 '22 #1

✓ answered by cactusdata

Try with:

Expand|Select|Wrap|Line Numbers
  1. =IIf(Not [CompleteDate] Is Null,
  2.     "Complete",
  3.     IIf([ReviewDate] <= Date(), 
  4.         "In Process",
  5.         IIf([DueDate] < Date()
  6.             "Overdue",
  7.             Null)))

2 16878
cactusdata
214 Expert 128KB
Try with:

Expand|Select|Wrap|Line Numbers
  1. =IIf(Not [CompleteDate] Is Null,
  2.     "Complete",
  3.     IIf([ReviewDate] <= Date(), 
  4.         "In Process",
  5.         IIf([DueDate] < Date()
  6.             "Overdue",
  7.             Null)))
Apr 1 '22 #2
zmbd
5,501 Expert Mod 4TB
@Teri B
When writing nested IIF() functions I usually start out by creating the skeleton code
(would you post back which database you're using)
Expand|Select|Wrap|Line Numbers
  1. Start with the outer IIF - notice the stepping of the code 
  2. stepping your code will help keep things straight in you mind
  3. IIF(condition, 
  4.    true, 
  5.    false
  6. )
  7. Now add the inner IIF(); in this example an on false 
  8. IIF(condition, 
  9.    true, 
  10.    IIF(condition2
  11.       true,
  12.       false
  13.    )
  14. )
  15. at this point keep adding and stepping
  16. - say I want a on true for the 3rd
  17. IIF(condition, 
  18.    true, 
  19.    IIF(condition2
  20.       IFF(condition3, 
  21.          true, 
  22.          false
  23.       ),
  24.       false
  25.    )
  26. )
  27.  
  28. quite often in VBA I'll comment the code as I go; unfortunately,
  29. most SQL will not let you add comments
  30. IIF(condition1,
  31.    'on true event condition1 
  32.    true, 
  33.    'on false event condition1 
  34.    IIF(condition2
  35.         'on true event condition2 
  36.       IFF(condition3,
  37.         'on true event condition3
  38.          true, 
  39.         'on false event condition3
  40.          false
  41.       ),
  42.       'on false event condition2
  43.       false
  44.    )
  45. )
  46. From this point, now that the skeleton is laid out, 
  47. insert your true and false actions at each branch 
  48. within the nested functions
  49.  
Apr 16 '22 #3

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

Similar topics

23
by: Paul Rubin | last post by:
OK, I want to scan a file for lines matching a certain regexp. I'd like to use an assignment expression, like for line in file: if (g := re.match(pat, line)): croggle(g.group(1)) Since...
70
by: Roy Yao | last post by:
Does it mean "(sizeof(int))* (p)" or "sizeof( (int)(*p) )" ? According to my analysis, operator sizeof, (type) and * have the same precedence, and they combine from right to left. Then this...
22
by: Tony Johansson | last post by:
Hello Experts! I'm reading i a book about C++ and they mention infix with telling what it is. I hope you out there can do so. Many thanks! //Tony
2
by: Mike Turco | last post by:
I like using the expression builder for a lot of different things but it isn't always available when I want to use it, for example in the code window, or in all of the control properties. I am...
14
by: John Temples | last post by:
Given this code: extern volatile unsigned char v; int main(void) { v; return 0; }
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
1
by: lovecreatesbea... | last post by:
---quoting--- Annex C (informative) Sequence points 1 The following are the sequence points described in 5.1.2.3: - The end of a full expression: an initializer (6.7.8); the expression in an...
28
by: Marc Gravell | last post by:
In Linq, you can apparently get a meaningful body from and expression's .ToString(); random question - does anybody know if linq also includes a parser? It just seemed it might be a handy way to...
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
0
by: madankarmukta | last post by:
Here is the Code Sample for converting the Given LINQ Expression to currosponding Expression Tree. //using LINQAlias = System.Linq.Expressions; List<Host> dinnerList = new List<Host>() ...
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: 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: 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

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.