Results 1 to 6 of 6

Thread: Offset records

  1. #1
    Join Date
    Oct 2005
    Posts
    12

    Question Unanswered: Offset records

    OK,so I've got another big chunk of extra data that I'm attempting to link into a database. Basically this one is a log of web traffic that needs to be sorted. I've written a little code to get the IP address off the beginning using the left() function and some tests, but how do i get to the real meat that comes after that? Basically, I'd like to go from the left 15 or so spaces (got another query to tell me just how far) and start reading that data there. Can Access 2002 do this or am i just out of luck?

    adam

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Sounds like the Mid Function will work for you.
    Paul

  3. #3
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    Look @ the help for

    ThisText = "Stephan Mckillen"
    Mid(ThisText,3,4) = "epha"

    Left(ThisText,3) = "e"
    Right(ThisText,3) = "l"

    let say I just want the Mckillen out of it ThisText

    WhereIsSpace = Instr(ThisText," ")

    mid([string],startat, endat)

    Surname = Mid(ThisText,WhereIsSpace+1,len(ThisText))




    whereisit = 4 as the p is the 4 place in

    that should keep you out of trouble
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    left$, Right$ mid$ are all worthy contenders for this requirement, as is instr.

    However I'd have a look at the split function it may do some of what you require - I'd forgotten that a web log file only uses the speech mark " for soem of its fields

  5. #5
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    healdem forgot about that one

    Split is good
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  6. #6
    Join Date
    Oct 2005
    Posts
    12

    Ya'll rock

    I sware, this forum rocks. I'll give some of that a whirl. Thanks guys.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •