Results 1 to 4 of 4
  1. #1
    senn2912 is offline Novice
    Windows 2K Access 2000
    Join Date
    Jan 2012
    Posts
    3

    Splitting Numbers before /

    Hi All,



    Can someone please help?

    I am trying to split out some number fields before a / but the difficulty i am having is that the number fields can vary from one a double number symbol to maybe one number symbol.

    For example:

    if it says 15/05 then i wanto to only show just 15

    or

    if its just 5/05 then to show just 5

    Hope this makes sense.

    Thanks in advance,

    Gary

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Show us the total string that is in this field, please. i.e.: 'This is the total string 5/05'

  3. #3
    senn2912 is offline Novice
    Windows 2K Access 2000
    Join Date
    Jan 2012
    Posts
    3
    05/5
    6/12
    4/05
    12/03

    Above is the string that i want to split.

    In one field of the query i want to return everything before / and then another field i want to return everything after the /.

    Hope that makes sense.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try this function or some variation of it.
    Code:
    Function Extract(strIn As String, TheLeft As Boolean) As String
    '-- Return the characters either prior to or after the "/" in strIn depending on TheLeft
       strIn = Trim(strIn)
       If TheLeft Then
          Extract = Left(strIn, InStr(strIn, "/") - 1)
       Else
          Extract = Mid(strIn, (InStr(strIn, "/") + 1))
       End If
    End Function

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Splitting my database.
    By bcox9 in forum Access
    Replies: 7
    Last Post: 12-17-2011, 06:23 PM
  2. Replies: 1
    Last Post: 11-29-2011, 08:43 AM
  3. Question splitting
    By joe1987 in forum Access
    Replies: 1
    Last Post: 11-16-2011, 04:45 PM
  4. Splitting Database
    By injanib in forum Database Design
    Replies: 0
    Last Post: 02-25-2011, 11:08 AM
  5. What is after Splitting!!
    By watzmann in forum Access
    Replies: 3
    Last Post: 09-07-2010, 07:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums