Results 1 to 6 of 6
  1. #1
    helpmeimpoor is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Posts
    5

    Delimiter condition

    So I created this delimiter:

    Left([tablename],InStr(tablename),".")-1)



    So if i have a name like mike .123, it will return me mike. The problem is, some names are "george" without any dot after and it returns func! error for these names.

    How can i set a condition so that above applies only when there exists a dot

  2. #2
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    As below:
    Code:
    Left([tablename], InStr(1, [tablename], ".") - IIf(InStr(1, [tablename], ".") = 0, -Len([tablename]), 1))

  3. #3
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Or Split(tablename,".")(0)
    For example

    ?split("mike .123",".")(0)
    mike
    ?split("george smith",".")(0)
    george smith
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  4. #4
    helpmeimpoor is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Posts
    5
    Quote Originally Posted by isladogs View Post
    Or Split(tablename,".")(0)
    For example

    ?split("mike .123",".")(0)
    mike
    ?split("george smith",".")(0)
    george smith
    HI

    sorry to bother you. So basically I want the dot removed and then i am running a relationship.

    Now in my other database, the names are all correct, without dots.

    In access, when I link the 2 databases together, the relationship only compares the name if the two did not have dots. For example, Mike .123 will not match with Mike in another database. But Mike will match with Mike in other database.

  5. #5
    helpmeimpoor is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Posts
    5
    Quote Originally Posted by isladogs View Post
    Or Split(tablename,".")(0)
    For example

    ?split("mike .123",".")(0)
    mike
    ?split("george smith",".")(0)
    george smith
    Click image for larger version. 

Name:	Capture6.PNG 
Views:	14 
Size:	98.2 KB 
ID:	39638

    please see attached picture. notice how where .rc. or other stuff, it doesnt look at relationship.



    UPDATEEEEEE:

    One solution I see if creating a new query where I am linking the edited query with the driver name, no issue then. But if its possible to work within existing query, it will be better i assume

  6. #6
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Sorry but I don't really understand your replies.
    You can use the expression as a new field in a query to join onto another table or query.
    However the Split function doesn't work in queries. Use the other approach
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

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

Similar Threads

  1. Parsing by using a delimiter in a query
    By MiaAccess in forum Queries
    Replies: 4
    Last Post: 08-28-2019, 08:50 PM
  2. Special Delimiter characters
    By cliff.clayman in forum Import/Export Data
    Replies: 12
    Last Post: 09-13-2016, 10:52 AM
  3. Delimiter expressions
    By kjcochran in forum Queries
    Replies: 3
    Last Post: 06-16-2013, 06:45 AM
  4. Using double quote as text delimiter
    By EddieN1 in forum SQL Server
    Replies: 4
    Last Post: 03-11-2012, 08:49 PM
  5. Using pound sign as date delimiter
    By EddieN1 in forum SQL Server
    Replies: 1
    Last Post: 03-07-2012, 10:38 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