Dividing Text

  • Thread starter Thread starter JOHN SMITH
  • Start date Start date
J

JOHN SMITH

Hi,

I have a text column with this type of information

8899-1
5454-2

How do it setup a function that will create two text fiels

WO Number, WO Sufix
8899 1
5454 2

Thank you All
 
Are you going to store the information as 8899-1, etc.? If so, in a
calculated query field (or an unbound control on a form or report) you could
have =Left([TextField],4) and in another =Right([TextField],1). If you mean
that you want to replace the table field containing 8899-1 with two separate
fields, you could use a Make-table query. Help is pretty clear on that topic.
 
Hi, and thanks for your posting.

I forgot to let you know that the number will vary

like
1234-1
40000-1
12012-9
400300-1




BruceM said:
Are you going to store the information as 8899-1, etc.? If so, in a
calculated query field (or an unbound control on a form or report) you could
have =Left([TextField],4) and in another =Right([TextField],1). If you mean
that you want to replace the table field containing 8899-1 with two separate
fields, you could use a Make-table query. Help is pretty clear on that topic.

JOHN SMITH said:
Hi,

I have a text column with this type of information

8899-1
5454-2

How do it setup a function that will create two text fiels

WO Number, WO Sufix
8899 1
5454 2

Thank you All
 
Hi,

I have a text column with this type of information

8899-1
5454-2

How do it setup a function that will create two text fiels

WO Number, WO Sufix
8899 1
5454 2

Thank you All

WONumber = Left([FullValue],Instr([FullValue],"-")-1)

If the Suffix value is always 1 character:
WOSuffix = Right([FullValue],1)

If the Suffix value can be more than one character:
WOSuffix = Mid([FullValue],Instr([FullValue],"-")+1)
 
Back
Top