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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIf

Status
Not open for further replies.

brbarto

Technical User
Joined
Sep 6, 2001
Messages
34
I need to print a "44" (earnings code) in a report if the AccountNumber starts with a 2; otherwise, I need to print "45". I am dealing with account numbers 0-00000 to 9-99999. I think the account numbers are stored without the hyphen. (I am using an input mask, 0\-00000.)
I think the following works, but is there a better way??
Is there anything like a wildcard (2*) I can use?

=IIf([AcctCharged]>=&quot;200000&quot; And [AcctCharged]<=&quot;299999&quot;,&quot;44&quot;,&quot;45&quot;)

Thanks,
A Beginner
 
Hi,

Your code looks fine but you could simplify it a little as follows :

IIf([AcctCharged]Like &quot;2*&quot;,&quot;44&quot;,&quot;45&quot;)

HTH

Jane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top