conditional IF not working not sure why

A

Andi Lee Davis

Hi There,

I have this in a query. Not sure why it is not working as it should do.

TuisNo: IIf([CUST_PO_NUMBER]="*" & "£A",[ORDER_NUMBER]," ")

CUST_PO_NUMBER ValeID ORDER_NUMBER TuisNo TuisNoCons
V_786397£B 786397 2007525
V_828224£B 828224 2033217
V_834641£A 834641 2036962
V_834643£B 834643 2036845
V_835293£A 835293 2041485
V_835406£B 835406 2037368
V_835472£A 835472 2037425
V_836589£A 836589 2038232

As you can see where the CUST_PO_NO ends in a £A I want it to return the
value of the ORDER_NUMBER in the TuisNo column. However it is not working.
Any suggestions?

thanks

Andi
 
6

'69 Camaro

Try:

TuisNo: IIf([CUST_PO_NUMBER] LIKE "*£A", [ORDER_NUMBER]," ")


HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
A

Andi Lee Davis

Hi There People,

Thanks.

I also found this worked in either column:

IIf(Right$([CUST_PO_NUMBER],2)="£B",[ORDER_NUMBER]," ")
IIf(Right$([CUST_PO_NUMBER],2)="£A",[ORDER_NUMBER]," ")

George Nicholson said:
Try:
IIf([CUST_PO_NUMBER] Like "*£A", [ORDER_NUMBER], " ")

HTH,
--
George Nicholson

Remove 'Junk' from return address.


Andi Lee Davis said:
Hi There,

I have this in a query. Not sure why it is not working as it should do.

TuisNo: IIf([CUST_PO_NUMBER]="*" & "£A",[ORDER_NUMBER]," ")

CUST_PO_NUMBER ValeID ORDER_NUMBER TuisNo TuisNoCons
V_786397£B 786397 2007525
V_828224£B 828224 2033217
V_834641£A 834641 2036962
V_834643£B 834643 2036845
V_835293£A 835293 2041485
V_835406£B 835406 2037368
V_835472£A 835472 2037425
V_836589£A 836589 2038232

As you can see where the CUST_PO_NO ends in a £A I want it to return the
value of the ORDER_NUMBER in the TuisNo column. However it is not working.
Any suggestions?

thanks

Andi
 
Top