[AccessD] values separated by .

Pedro Janssen pedro at plex.nl
Fri Feb 18 14:41:55 CST 2005


Hello Gustav,

although its working fine, i did not notice the following before
when using:   ExtractN = Split("6.11.3.1.2(0m).1.0.1", ".")(1)

the value it is returning =

11

i realy need that first value to.

I could place an . for the value with an update query, but can it been done
in the function to.

Pedro




----- Original Message -----
From: "Gustav Brock" <Gustav at cactus.dk>
To: <accessd at databaseadvisors.com>
Sent: Friday, February 18, 2005 7:37 PM
Subject: Re: [AccessD] values separated by .


> Hi Pedro
>
> It needs two params: the string, and the element (0 to 7) to extract:
>
>   ExtractN("6.11.3.1.2(0m).1.0.1", 4)
>
> /gustav
>
> >>> pedro at plex.nl 18-02-2005 19:20:30 >>>
> Hello Gustav,
>
> thanks for the help (also thanks Borge and Jim).
> When i call the punction in the On Click event i get an error: The
> expression you entered has a function containing the wrong number of
> arguments.
>
> What is going wrong.
> I don'r see it (but this also could be the result of my headache while
> having the flu)
>
> Pedro
>
>
>
> ----- Original Message -----
> From: "Gustav Brock" <Gustav at cactus.dk>
> To: <accessd at databaseadvisors.com>
> Sent: Friday, February 18, 2005 3:23 PM
> Subject: Re: [AccessD] values separated by .
>
>
> > 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.
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>





More information about the AccessD mailing list