Access - "*" como lo separo

 
Vista:

"*" como lo separo

Publicado por mario (53 intervenciones) el 09/07/2003 20:18:12
hola grupo
yo tengo un campo con el siguente dato:
PO1*0001*16*EA*89.6**CB*4WZ77*VN*GR10L
yo necsito que:
0001 se vaya a campo 1
16 " " 2
EA " " 3
89.6 " " 4
4WZTT "" 5
GR10L "" 6
COMO PODRIA HACER ESTO EN FORMA AUTOMATIZADA, SE QUE SE PUEDE CON UNA FUNCION PERO NO LA TENGO
GRACIAS1

Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:

Publicado por MBELLIDO (271 intervenciones) el 10/07/2003 13:07:19
SEGUN LO QUE DICES LO PUEDES HACER CON LA FUNCION MID() SIEMPRE Y CUANDO EL CAMPO TENGA UNA LONGITUD FIJA Y CADA SEGMENTO SEA SIEMPRE DE LA MISMA LONGITUD.
CAMPO1 = MID(CAMPO;5;4)
CAMPO2 = MID(CAMPO;10;2)
CAMPO3=MID(CAMPO;13;2)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:

Publicado por mario (53 intervenciones) el 10/07/2003 16:03:05
gracias de antemano encontre una funcion entre mis librerias, esta funcion es de un autor registrado , aqui se los doy publicamente
Function Parser1(strOperand As Variant, intPosition As Integer, strDelimiter As String)

' Pull the requested token from strOperand, delimited by
' strDelimiter.
' Example: Parser("109,253,1070,109621,8", 3, ",")
' would return "1070"' Example: Parser("a*stich*in*time*saves*nine", 5, "*")
' would return "saves"
' strOperand can be string or field
Dim intPos As Integer
Dim intPos1 As Integer
Dim intCount As Integer
intPos = 0
For intCount = 0 To intPosition - 1
intPos1 = InStr(intPos + 1, strOperand, strDelimiter)
If intPos1 = 0 Then
intPos1 = Len(strOperand) + 1
End If
If intCount <> intPosition - 1 Then
intPos = intPos1
End If
Next intCount
If intPos1 > intPos Then
Parser1 = Mid$(strOperand, intPos + 1, intPos1 - intPos - 1)
Else
Parser1 = Null
End If
End Function

gracias
Mario
Bowling Green
Kentucky USA
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar