[AccessD] values separated by .

Gustav Brock Gustav at cactus.dk
Fri Feb 18 08:23:21 CST 2005


Hi Pedro

As Jim mentions, I think Split will do.
It creates an array but have in mind you can address the elements of
this directly with this syntax:

  strElementn = Split("6.11.3.1.2(0m).1.0.1", ".")(n)

Thus, for field E use

  strElementE = Split("6.11.3.1.2(0m).1.0.1", ".")(4)

which returns 

  2(0m)

However, SQL doesn't seem to be happy with this syntax, so you may have
to run VBA to update this or create a small wrapper function which does
the extract:

Public Function ExtractN(ByVal strList As String, ByVal lngElement As
Long) As String

  On Error Resume Next
  ExtractN = Split(strList, ".")(lngElement)

End Function

/gustav


>>> pedro at plex.nl 18-02-2005 14:00:02 >>>
Hello group,

I have a field [formula] with values that look like: 
6.11.3.1.2(0m).1.0.1
Each value is separated by a dot  (.) 
As you can see, not al values are numbers.

I would like each value in a separated field. FieldA to FieldH.

I could do this with Left, Right or Middle function, but it takes time
an 8 functions

Is there a better way to do this in one.

Pedro Janssen




More information about the AccessD mailing list