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

splitting data in one field into 2 fields 1

Status
Not open for further replies.

ch4meleon

Technical User
Jan 13, 2003
60
GB
Im hoping someone can help with this one, i have a field in a table that contains a 6 digit number followed by a description, i want to split this into 2 fields, the number and the description seperated ?

any help gratefully received

:)
 
Have you tried something like

for the numeric:
Code:
SUBSTR([i]CombinedField[/i],1,6) AS MyNumberField

for the non-numeric:
Code:
SUBSTR([i]CombinedField[/i],7,LEN(TRIM(CombinedField))-6) AS MyDescriptionField

- the LEN bit will calculate the length of the trimmed field and then substract 6 from this... as you've already taken the first six characters for your number field
 
In the query grid:
number: Val(Left([yourField], 6))

description: Mid([yourField], 7)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you both for replying !! PHV thats great, nice and easy :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top