A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Mutiple Condition Expression



 
 
Thread Tools Display Modes
  #1  
Old July 8th, 2004, 02:44 PM
GLS
external usenet poster
 
Posts: n/a
Default 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  
Old July 8th, 2004, 04:20 PM
Wayne Morgan
external usenet poster
 
Posts: n/a
Default 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  
Old July 9th, 2004, 08:54 AM
GLS
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 05:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.