Results 1 to 3 of 3
  1. #1
    Topcerv is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    4

    Exclamation Problem with extracting variable data from a string

    I have a table that lists items in a fully qualified domain name and I need to list the hostnames of the systems in a seperate field without the FQDN. For example:

    FIELD: FHOSTNAME
    DATA: dcsdc1.dcsecurity.com

    I will run an update query with the below string to the destination SHostname and I get the relfected output.

    Left([FHostname],Len([FHostname])-(InStr([FHostname],'.')))



    FIELD: SHOSTNAME
    DATA: dcsdc1.dcsecu


    What I am trying to get pulled is the DCSDC1 which is the short hostname.

    Any one see my error?
    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,973
    Try

    Left([FHostname],InStr([FHostname],'.')-1)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Topcerv is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    4
    Works Great! Thanks.

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

Similar Threads

  1. Replies: 1
    Last Post: 06-08-2012, 02:45 PM
  2. Extract Value from Variable in String
    By nguyenak in forum Programming
    Replies: 3
    Last Post: 05-24-2012, 03:50 PM
  3. Replies: 1
    Last Post: 02-03-2011, 07:41 AM
  4. Replies: 4
    Last Post: 08-05-2010, 01:26 PM
  5. Using a string variable to specify a control
    By Gerry in forum Programming
    Replies: 3
    Last Post: 04-14-2010, 02:28 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