Substituting values in a query

  • Thread starter Thread starter Gez
  • Start date Start date
G

Gez

Hi,

There's an option in the word object library to surpressing blank lines when
automating a mail merge. The problem is that within my database instead of
blank fields I have values "N/A". This is by design as they are the default
values in corresponding Lookup Tables for Town, Region and Country. Is
there any way of creating an expression within a query that substitues one
value for another e.g. expr: if fldCountryName = "N/A" then expr = "".

Thanks,

Geraint
 
Forget that question I've just done it by adding the following expression to
the query:

Expr1: IIf([fldCountryName]="n/a","",[fldCountryName])
 
Is
there any way of creating an expression within a query that substitues one
value for another e.g. expr: if fldCountryName = "N/A" then expr = "".

Sure:

IIF([fldCountryName] = "N/A", "", [fldCountryName])

I have to be a bit dubious about your default lookup values though!
 
Back
Top