Good morning,
I have a text field in a query that contains 3 sets if data that I am trying to pull out. I have tried using the Switch function and the IIF but when I combine more than one statement it does not work.
I am using ACCESS 2003 and do not know VBA.
Below is not code but just a written statement of what I need to do:
if {TXNCD} = "12" then LEFT (ORDNUM}, 5) else
if {TXNCD} = "13" then LEFT (ORDNUM}, 5) else
if {TXNCD} = "41" then LEFT (ORDNUM}, 7)
I have tried the following code in the query:
Any Suggestions?
Clay
Clay
I have a text field in a query that contains 3 sets if data that I am trying to pull out. I have tried using the Switch function and the IIF but when I combine more than one statement it does not work.
I am using ACCESS 2003 and do not know VBA.
Below is not code but just a written statement of what I need to do:
if {TXNCD} = "12" then LEFT (ORDNUM}, 5) else
if {TXNCD} = "13" then LEFT (ORDNUM}, 5) else
if {TXNCD} = "41" then LEFT (ORDNUM}, 7)
I have tried the following code in the query:
Code:
IIf([TXNCD]="12" Or "13",Left([ORDNUM],5) Or IIf([TXNCD]="41",Left([ORDNUM],7))
Any Suggestions?
Clay
Clay