Conditional update field in sql

S

Stukmeister

I need to update a field conditionally in sql. For example: if file.error =
"A" set file.description = "Error A" else set file.description = "Unknown".
Is there a way to do this with one sql statement?
 
B

Brian

Stukmeister said:
I need to update a field conditionally in sql. For example: if file.error =
"A" set file.description = "Error A" else set file.description = "Unknown".
Is there a way to do this with one sql statement?

SET file.description = Iif(file.error="A","Error A","Unknown")
 
Top