472,107 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,107 software developers and data experts.

Access module into MySQL

Someone here helped me in the past when I was trying to do this in Access, but now that I'm trying to learn MySQL, I have no idea how to do this.

I have bulk table imports; one field (LongClass) has data that looks like this. ALW 25000N1X, ALW 5000N3X , ALW 15235s.

What I've wanted to do is find a manner to remove those center numerics so that the LongClass is reduced to ALW N1X, ALW N3X and ALW s respectively upon it's import/conversion into the standard data table. As you can see, the length of that numeric is variable.

The kind person in the past was able to give me this code for a module in Access:

Expand|Select|Wrap|Line Numbers
  1. Public Function fParseString(strMyString As String)
  2. Dim varString As Variant
  3. Dim strPart1 As String
  4. Dim strPart2 As String
  5. Dim intCounter As Integer
  6.  
  7. varString = Split(strMyString)
  8.  
  9. strPart1 = varString(0)
  10.  
  11. 'find 1st non-numeric value in the 2nd element, then extract
  12. 'from that point on
  13. For intCounter = 1 To Len(varString(1))
  14.   If Not IsNumeric(Mid$(varString(1), intCounter, 1)) Then
  15.     fParseString = strPart1 & " " & Mid$(varString(1), intCounter)
  16.       Exit Function
  17.   End If
  18. Next
  19. End Function
And then when I ran my query, I would merely use fparsestring([LongClass]) and it would output properly.

Now, I'm just learning MySQL so I'm afraid my ability to converse back and forth would be minimal if there's further questions. But if anyone can look at this and help me figure out what the best way forward is, I'd be happy. Thank you.
Nov 19 '08 #1
0 1413

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Otto Krüse | last post: by
reply views Thread by someone92 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.