Results 1 to 8 of 8
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Query problem (2003)

    In a previous post, <post#=481534>post 481534</post#> , I had major problems, which, with your help was sorted. A problem has arisen, were two users have similar initials. If I typed in JM before it would find occurences like JMc/LG, LG/JMc or any other combination. The persons initials are, bye the way, JMc. This was ok until recently, when another JM joined the company. How can I tell the query that if I search for JM, it could be JM/RB or RM/JM but no JMc.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query problem (2003)

    Does the attached version do what you want?

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Query problem (2003)

    Yes thats what I want, thanks. Could you explain to me what you've done please.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query problem (2003)

    I've used a sneaky, but simple and powerful trick: I put the separator "/" before and after the Actionee field in the query, so that its values look like
    <code>
    /CL/LA/DMcK/
    </code>
    and I also put "/" before and after the Enter Actionee parameter, so that if the user enters DM, it looks like
    <code>
    /DM/
    </code>
    The presence of the separators ensures that the initials entered by the user are only found as complete initials, not as part of them.

  5. #5
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Query problem (2003)

    Thanks Hans, brilliant.

  6. #6
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Query problem (2003)

    Another request I'm afraid. Another report is required where only the first entry is required. So if DM was entered LC/JM/DM or DMc/LC/DM would be ignored, but DM/LC/ wouldn't

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query problem (2003)

    Take the query from the database I attached earlier, and change the criteria
    <code>
    Like "*/" & [Enter Actionee] & "/*"
    </code>
    to
    <code>
    Like "/" & [Enter Actionee] & "/*"
    </code>
    i.e., remove the first asterisk but not the second one.

  8. #8
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Query problem (2003)

    Thanks Hans.

Posting Permissions

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