Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

switch function

Status
Not open for further replies.

farquar

Programmer
Joined
Nov 21, 2001
Messages
14
Location
GB
I have a ticket description field (ticket_desc) which contains E.g Single, Return

I have an indicator field which can contain a ref number (card_no).

I am using the switch function and I want to say:

if the card_no field is not null then the ticket_desc field should display 'Free', if it is null then it should just display the ticket_desc value.

my code at the moment is this, but it won't accept it:

Switch([card_no=null,tbl_ticket_type.ticket_desc,True,"Free"])

Does the switch command allow you to refer to a field rather than a fixed value ?

I am an oracle developer and SO miss my DECODE facility!!

Cheers
 
just have a field with the following
IIF(ISNULL([Card_No]),[Ticket_Desc],"Free")
 
Thanks, I failed to mention that I am doing this in an sql query, is this ok ?
 
if your using the sql builder within access it should be fine just add in your field name at the end so:
Select IIF(ISNULL([Card_No]),[Ticket_Desc],"Free") as FieldName
 
cheers, ta, thank you, merci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top