Results 1 to 6 of 6

Thread: Expression

  1. #1
    Join Date
    Jan 2003
    Location
    Cleveland, Ohio
    Posts
    10

    Unanswered: Expression

    I am trying to build a query that will put the data of one field into a new field made by the query. Example, the data of is either cancelled or deleted based upon a date of 1/1/99. if it it 1/1/99 then the new field should show cancelled otherwise it should show deleted. I tried to build the expression Completion Status[Completion Date]="1/1/99","Cancelled","Delayed") but I get #error on the query. Any hints???

  2. #2
    Join Date
    Nov 2002
    Location
    Hillsboro, OR, USA
    Posts
    59

    Re: Expression

    Code:
    iif([Completion Date]="1/1/99","Cancelled","Delayed")
    Any better?

  3. #3
    Join Date
    Jan 2003
    Location
    Cleveland, Ohio
    Posts
    10

    Re: Expression

    Originally posted by bri
    Code:
    iif([Completion Date]="1/1/99","Cancelled","Delayed")
    Any better?
    no,....thanks anyway..thats what I have..still errors......

  4. #4
    Join Date
    Jan 2003
    Location
    Cleveland, Ohio
    Posts
    10

    Oh yeah

    I forgot to mention that there are other records in that feild that are complete the only ones that need changed are the 1/1/99 and the null records. The null records are the ones that need to say delayed. Any help would be greatly appreciated!!

  5. #5
    Join Date
    Jan 2003
    Posts
    15
    Put number signs before and after date so it recognizes that it is a date field. Also, your Null values can be screwing you up... might want to query Null values first.

  6. #6
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    try:

    Result = iif(isnull([Completion Date]), ValueforNull, iif([Completion Date] = #1/1/99#, ValueFor1199, ValueForNotNullandNot1199))

    from your posts, i guess:
    ValueforNull = "Delayed"
    ValueFor1199 = "Cancelled"
    ValueForNotNullandNot1199 = ?? not clear what you want to do here

    izy

Posting Permissions

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