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
 need help

Author  Topic 

eugz
Posting Yak Master

210 Posts

Posted - 2012-01-19 : 15:47:03
Hi All.
I have

SELECT d.*
FROM
(
SELECT
pr.ProviderID
,FNAME + ' ' + LNAME ProviderName
,CASE WHEN LEN(ContactInfo) < 6 THEN CentralizeStaff.dbo.fn_FormatExt(ContactInfo)
WHEN LEN(ContactInfo) < 11 THEN CentralizeStaff.dbo.fn_FormatPhone(ContactInfo) end Phone
,CASE WHEN ContactInfo NOT LIKE '%@%' THEN 1 ELSE 0 END AS Include
FROM dbo.Provider pr
LEFT JOIN dbo.ProviderContact c
on c.ProviderID = pr.ProviderID
)d
WHERE d.Include = 1


and as a result
560 AAA BBBB 2-2222 1
560 AAA BBBB (917) 123-4562 1

How to modify that select that result will look like, etc. grouping by NAME
560 AAA BBBB 2-2222 1
560 (917) 123-4562 1

Thanks.

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-19 : 16:34:20
sure..use a reporting tool

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

eugz
Posting Yak Master

210 Posts

Posted - 2012-01-20 : 09:57:17
Hi Brett.
Can you explain more detail?

Thanks.
Go to Top of Page
   

- Advertisement -