Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Pull Email Address from Employee Id

Author  Topic 

Najju565
Starting Member

6 Posts

Posted - 2014-01-28 : 03:56:24
There is a Table DISPLAY_DETAILS in which a Column - DISPLAY_NAME, which displays data in it as : Joe Barnard(123456);Paul Johnson(114454); - Display as Name(Employee Id).

There is a EMployee Master Table EMP_MASTER Which contains Employee Id and Email Address Columns.

From this: Joe Barnard(123456);Paul Johnson(114454); I need to get the Email Address for these Employee Ids - 123456 and 114454
Require your help on the same soon.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-01-28 : 05:25:59
[code]SELECT *
FROM
DISPLAY_DETAILS INNER JOIN EMP_MASTER
ON substring(DISPLAY_NAME, charindex('(', DISPLAY_NAME) + 1, charindex(')', DISPLAY_NAME) - charindex('(', DISPLAY_NAME) - 1) = EMPLOYEE_ID[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Najju565
Starting Member

6 Posts

Posted - 2014-01-28 : 05:37:38
Giving Email Id only for one EmployeeId: 123456, need to get Email Id for this EMployee Id also: 114454. Please help
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-01-28 : 06:01:32
same as
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=190961

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -