Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004

    Unanswered: email and domain match query

    i have two columns in diferent tables, one is email and the other is domain. I was wondering if i could run a query that would tell me how many email i have with each of the domains listed. Can I do this with out parsing the domain from the email, I figure you could do it that way but i was wondering if i could do it with a "Like" some how.


  2. #2
    Join Date
    Jul 2004
    To find an exact match between the email address and the domain name, you can use a simple string comparison with the Instr() function as follows:

    intDNN = Instr(1,strEmailAddr,"@")
    . . . . where intDNN would indicate the character position of @.

    strDomainSeg = Right$(strEmailAddr,(Len(strEMAilAddr)-intDNN))

    If Right$(strDomainName, Len(strDomainSeg)) = strDomainSegment Then
    . . . . it's a match . . .
    End If

  3. #3
    Join Date
    Jun 2004
    Thanks a lot I had not thought of that. I do not know a lot about the instr and this is a very interesting way of using it. Very creative. Thank you

Posting Permissions

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