Relating tables barely related.

  • I have two tables that are only somewhat related and would like to pull data from table 2 about the UserName in Table 1.

    Table1 has UserLogin and logged in.

    The User Login in looks like: Domain\UserName and varies in length 14-29 Characters

    The username is part of the employees name.

    Table 2 has employee information that I want to link to:

    EmployeeID, FName, LName, Phone etc…..

  • you can do what some people call an exotic join...joins that are not T1.field = T2.field

    but things like :

    ON UserName = REPLACE(Userlogin,'\Domain','')

    or on char index/patindex

    ON (CHARINDEX(UserName , Userlogin) != 0)

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply