From: tom on
I am fairly new to using Access and I need some assistance in working with an
expression....

Working with Access 2007 I have a table that has a column (Name) with
several clients names in it and I would like to write an expression that
isolates Bank of America and labels all other clients as "Misc".

Example:
Current Return Desired

Name (Column Name) Name (Column Name)
BofA BofA
BofA BofA
BofA BofA
24 HR Fit Misc
Subway Misc
Subway Misc
Albertsons Misc
Wendy's Misc
Sharky's Misc

Thank you for your help!
From: XPS350 on
On 28 mrt, 17:06, tom <t...(a)discussions.microsoft.com> wrote:
> I am fairly new to using Access and I need some assistance in working with an
> expression....
>
> Working with Access 2007 I have a table that has a column (Name) with
> several clients names in it and I would like to write an expression that
> isolates Bank of America and labels all other clients as "Misc".
>
> Example:
> Current                                      Return Desired
>
> Name (Column Name)                 Name (Column Name)
> BofA                                           BofA
> BofA                                           BofA
> BofA                                           BofA
> 24 HR Fit                                     Misc  
> Subway                                       Misc  
> Subway                                       Misc
> Albertsons                                   Misc
> Wendy's                                      Misc
> Sharky's                                      Misc
>
> Thank you for your help!

You use the IIF function in a query rather than the IF statement.

In your case it could look like: IIF(Name="BofA";"BofA";"Misc")

Groeten,

Peter
http://access.xps350.com
From: Leo on
Peter,
In the Iff statement each argument is separated by a ";". Is that right or
should it be ","?

Thanks
Leo

"XPS350" wrote:

> On 28 mrt, 17:06, tom <t...(a)discussions.microsoft.com> wrote:
> > I am fairly new to using Access and I need some assistance in working with an
> > expression....
> >
> > Working with Access 2007 I have a table that has a column (Name) with
> > several clients names in it and I would like to write an expression that
> > isolates Bank of America and labels all other clients as "Misc".
> >
> > Example:
> > Current Return Desired
> >
> > Name (Column Name) Name (Column Name)
> > BofA BofA
> > BofA BofA
> > BofA BofA
> > 24 HR Fit Misc
> > Subway Misc
> > Subway Misc
> > Albertsons Misc
> > Wendy's Misc
> > Sharky's Misc
> >
> > Thank you for your help!
>
> You use the IIF function in a query rather than the IF statement.
>
> In your case it could look like: IIF(Name="BofA";"BofA";"Misc")
>
> Groeten,
>
> Peter
> http://access.xps350.com
> .
>
From: Sylvain Lafontaine on
The value of the list separator - either the comma , or the semi-coma ; -
used by Access depends on the Regional setting of your computer.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
Independent consultant and remote programming for Access and SQL-Server
(French)


"Leo" <Leo(a)discussions.microsoft.com> wrote in message
news:3C2F39C9-8623-49FD-993B-7B02C1A54172(a)microsoft.com...
> Peter,
> In the Iff statement each argument is separated by a ";". Is that right
> or
> should it be ","?
>
> Thanks
> Leo
>
> "XPS350" wrote:
>
>> On 28 mrt, 17:06, tom <t...(a)discussions.microsoft.com> wrote:
>> > I am fairly new to using Access and I need some assistance in working
>> > with an
>> > expression....
>> >
>> > Working with Access 2007 I have a table that has a column (Name) with
>> > several clients names in it and I would like to write an expression
>> > that
>> > isolates Bank of America and labels all other clients as "Misc".
>> >
>> > Example:
>> > Current Return Desired
>> >
>> > Name (Column Name) Name (Column Name)
>> > BofA BofA
>> > BofA BofA
>> > BofA BofA
>> > 24 HR Fit Misc
>> > Subway Misc
>> > Subway Misc
>> > Albertsons Misc
>> > Wendy's Misc
>> > Sharky's Misc
>> >
>> > Thank you for your help!
>>
>> You use the IIF function in a query rather than the IF statement.
>>
>> In your case it could look like: IIF(Name="BofA";"BofA";"Misc")
>>
>> Groeten,
>>
>> Peter
>> http://access.xps350.com
>> .
>>


From: John W. Vinson on
On Sun, 28 Mar 2010 16:26:01 -0700, Leo <Leo(a)discussions.microsoft.com> wrote:

>Peter,
>In the Iff statement each argument is separated by a ";". Is that right or
>should it be ","?

Depends on where you are: some countries use one, some use the other. In the
US use a comma; in Germany use a semicolon; I'm not sure even how to find out
which countries use which.
--

John W. Vinson [MVP]