[AccessD] values separated by .

Jim DeMarco Jdemarco at hudsonhealthplan.org
Fri Feb 18 15:01:57 CST 2005


Pedro

Try:

ExtractN = Split("6.11.3.1.2(0m).1.0.1", ".")(0)

if your problem is retreivng the first value from the array.

Jim DeMarco

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Pedro Janssen
Sent: Friday, February 18, 2005 3:42 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] values separated by .


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
>
>


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


 



***********************************************************************************
"This electronic message is intended to be for the use only of the named recipient, and may contain information from Hudson Health Plan (HHP) that is confidential or privileged.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited.  If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message.  Thank You".
***********************************************************************************




More information about the AccessD mailing list