Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067

    Unanswered: Problem with Multi IIF Function

    I have a problem with this function ive been working on and have been staring at it for about 1/2 an hour

    Code:
    Expr1: 
    IIf([ARISEAEM].[WL TYPE]<=1,IIf([ARISEAEM].[ADM TYPE]<12,
    IIf(Right$([ARISEAEM].[MEDREC-DETAILS],2)=":1",
    IIf([ARISEAEM].[FACILITY] Mod 2=0,"Remove","Remove"))
    ,"Non-Elective Inpatient"),"Non-Elective Inpatient")
    it's probably something really stupid, it's leaving out 2 rows having blanks instead of ("Non-Elective Inpatient")

    or if there is a better way of doing this kind of thing (instead of embedding multiple if statements it) that would be great also

    David

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Any chance the records you're having problem have null field values?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    never mind got it sorted, additional bracket, 1 to few ,"Non-Elective Inpatient")

  4. #4
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    no i managed to think of that already, when youve been writing these things for about 3 days your brain goes a bit to mush

  5. #5
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    hahaha yeah David. Looks like the case of missing brackets
    Ryan
    My Blog

  6. #6
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Hi Ryan, you still here i thought you were away on a new project? anyway is there a better function to use im sick of imbedding these IIF's, like a select case or similar

  7. #7
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by DavidCoutts
    Hi Ryan, you still here i thought you were away on a new project? anyway is there a better function to use im sick of imbedding these IIF's, like a select case or similar
    Just hit the nail on the head...CaseSelect is the way to go when you have so many IIF statements or Imbedded IF statements. Know how to work those??

    Bud

  8. #8
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    not really but i will look into it, I suggeted select case as that is the way id do it with VB, but i really need to improve my Access Functions

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •