View Single Post
  #2  
Old October 7th, 2009, 08:32 PM posted to microsoft.public.access.queries
Piet Linden[_2_]
external usenet poster
 
Posts: 280
Default Simple Query Expression

On Oct 7, 2:21*pm, Agent_KGB
wrote:
Hello, i am trying to build an expression that will compare two fields and
will either create new value or copy current value from one of the fields....

I have two fields in my query: "Flag" (Red, Blue, Green, etc) "Notes" (text
field)

What i want is to check both fields and anytime there is a record with "Red"
flag and something in "Notes" field it will put "Red Flag with Notes" in
expression field, and for all other records it will simply copy the value
from "Flag" field.

I am sure it's a simple query, i just wish i'd knew how to write it.


IIF(Not(IsNull([Notes])) AND [Flag] = "Red", "Red Flag with Notes",
[Flag])