Wildcards and formulas

D

djd

Is it possible to assign wildcard values when writing formulas to search for
all values in the name field that begin with a certain number? For example
all tasks that begin with 1XXX would be classified as "Task A". I tried to
use :

iif([name]="1***","Task A",false)

but does not work. Any ideas?

Thanks for your help
DJD
 
J

JackD

Use the traditional text functions like left.

iif(left([Name],1) = "1","Task A", "")

Or you could do something like this:

IIf(len([Name])>3,IIf(left([Name],4)>999 And left([Name],4)<2000,"Task
A","foo"),"foo")

You need to test the length of the string first or you get an error when you
take the first 4 characters or a name which is less than 4 characters long.

I can't figure out what you are expecting to achieve with a value of false.
Since the first value "Task A" is a string it most likely goes into a text
field. The value false has no meaning there. Perhaps you mean to say "" ?
 
G

Gérard Ducouret

Hello,
No wildcard but a lot of text functions. Try the following :
IIf(Left([Name];1)="1";Yes;No)

Gérard Ducouret
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top