If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Mutiple Condition Expression
Hi
I work in a hospital and have a table of patient data including two columns - one showing the date the patient was referred [Referral Date]and another showing how many days the patient had waited [Length of Wait]. I want to build an expression that will say "Action Required" when the patient has waited more than 242 days, or "No Referral Date" where the [Referral Date] field is null. I tried variations on iif(Or([Length of Wait]242,"Action Required", [Referral Date]Is Null,"No Referral Date")"") but just cant get it to work. Any help much appreciated GLS |
#2
|
|||
|
|||
Mutiple Condition Expression
Which do you want to take precedence? If there is no referral date do you
want "No Referral" to show or the [Length of Wait] message to show? Is [Length of Wait] a calculated field or something the user types in? If a calculated field, could you just do the calculation instead of storing this in the table? Assuming "No Referral" has precedence: IIf(IsNull([Referral Date]), "No Referral", IIf([Length of Wait]242, "Action Required")) -- Wayne Morgan Microsoft Access MVP "GLS" wrote in message ... Hi I work in a hospital and have a table of patient data including two columns - one showing the date the patient was referred [Referral Date]and another showing how many days the patient had waited [Length of Wait]. I want to build an expression that will say "Action Required" when the patient has waited more than 242 days, or "No Referral Date" where the [Referral Date] field is null. I tried variations on iif(Or([Length of Wait]242,"Action Required", [Referral Date]Is Null,"No Referral Date")"") but just cant get it to work. Any help much appreciated GLS |
#3
|
|||
|
|||
Mutiple Condition Expression
Thanks very much Wayne. That worked perfectly.
The Length of wait is a calculation based on todays date minus the referreal date, therefore, when there is no referral date the length of wait column is blank. many thanks GLS -----Original Message----- Which do you want to take precedence? If there is no referral date do you want "No Referral" to show or the [Length of Wait] message to show? Is [Length of Wait] a calculated field or something the user types in? If a calculated field, could you just do the calculation instead of storing this in the table? Assuming "No Referral" has precedence: IIf(IsNull([Referral Date]), "No Referral", IIf([Length of Wait]242, "Action Required")) -- Wayne Morgan Microsoft Access MVP "GLS" wrote in message ... Hi I work in a hospital and have a table of patient data including two columns - one showing the date the patient was referred [Referral Date]and another showing how many days the patient had waited [Length of Wait]. I want to build an expression that will say "Action Required" when the patient has waited more than 242 days, or "No Referral Date" where the [Referral Date] field is null. I tried variations on iif(Or([Length of Wait]242,"Action Required", [Referral Date]Is Null,"No Referral Date")"") but just cant get it to work. Any help much appreciated GLS . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
expression built sting / Parsing text field | Andre | General Discussion | 2 | June 25th, 2004 04:39 PM |
ERROR on expression in my form | Nadia | Using Forms | 5 | June 4th, 2004 08:46 PM |
Need help w/ expression | Tom | Setting Up & Running Reports | 2 | May 29th, 2004 10:21 PM |
Expression (Checkbook) | Tom | Running & Setting Up Queries | 0 | May 29th, 2004 02:38 PM |