dbTalk Databases Forums  

IIF Conditional Statement

comp.databases.ms-access comp.databases.ms-access


Discuss IIF Conditional Statement in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tony
 
Posts: n/a

Default IIF Conditional Statement - 01-07-2005 , 01:01 PM






What I am trying to do is create a page header with a text box,
controlled by this formula:

=IIf([CITY] Like "C"=True,"Calgary","Edmonton")

The field [CITY] can either be a "C" or "E", I know this should be
easy to figure this out but it's taking me tooooo long! Could someone
please help me out with this?

Reply With Quote
  #2  
Old   
PC Datasheet
 
Posts: n/a

Default Re: IIF Conditional Statement - 01-07-2005 , 01:36 PM






If [City] is specifically either C or E, use this:
=IIf([CITY] = "C","Calgary","Edmonton")

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
resource (AT) pcdatasheet (DOT) com
www.pcdatasheet.com


"Tony" <anthony.hendrata (AT) gmail (DOT) com> wrote

Quote:
What I am trying to do is create a page header with a text box,
controlled by this formula:

=IIf([CITY] Like "C"=True,"Calgary","Edmonton")

The field [CITY] can either be a "C" or "E", I know this should be
easy to figure this out but it's taking me tooooo long! Could someone
please help me out with this?



Reply With Quote
  #3  
Old   
jv
 
Posts: n/a

Default Re: IIF Conditional Statement - 01-07-2005 , 01:40 PM



If you wan to see if the first letter is a C then use this

=IIf([CITY] Like "C*","Calgary","Edmonton")
or

=IIf(left([CITY],1)="C","Calgary","Edmonton")

Good Luck.

Julie


Reply With Quote
  #4  
Old   
Trevor Best
 
Posts: n/a

Default Re: IIF Conditional Statement - 01-07-2005 , 02:33 PM



Tony wrote:
Quote:
What I am trying to do is create a page header with a text box,
controlled by this formula:

=IIf([CITY] Like "C"=True,"Calgary","Edmonton")

The field [CITY] can either be a "C" or "E", I know this should be
easy to figure this out but it's taking me tooooo long! Could someone
please help me out with this?
IIf([CITY]="C","Calgary","Edmonton")

Or if it's just the first letter:
IIf([CITY] like "C*","Calgary","Edmonton")

--
This sig left intentionally blank


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.