ACCESS Update Query with If Then Else????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can't find any reference when seacrhing through the Forums on how to do this kind of update... unless there are just so many that I can't see the forest through the tree.

What I want to do is to use Criteria in 2 fields. If both criteria are met, set a field to one value. If the criteria are not correct, set it to another.

I know there's gotta be a way to do this.

THanks
 
Can't find any reference when seacrhing through the Forums on how to do this kind of update... unless there are just so many that I can't see the forest through the tree.

What I want to do is to use Criteria in 2 fields. If both criteria are met, set a field to one value. If the criteria are not correct, set it to another.

I know there's gotta be a way to do this.

THanks

UPDATE YourTable SET YourTable.FieldName = IIf([LastName]="Smith" And
[FirstName]="John",SomeNumberValue,OtherNumberValue);

Text values must be enclosed within quotes, number values do not get
the quotes.
 
Back
Top