User Profile

Collapse

Profile Sidebar

Collapse
K3nSchr0eder
K3nSchr0eder
Last Activity: Feb 5 '13, 07:42 AM
Joined: Feb 3 '13
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thank you both sooo much for your assistance. I have now got exactly what I wanted.
    Here is the final query:
    Code:
    SELECT     HomeCareAgencies.*,
               ((SELECT DISTINCT',' + Services 
                  FROM ILCounties 
                  WHERE HomeCareAgencies.Mnemonic = ILCounties.Mnemonic
                  FOR XML PATH('')))AS ILService,
                  ((SELECT DISTINCT ',' + County
                    FROM ILCounties
    ...
    See more | Go to post

    Leave a comment:


  • @Rabbit YOU ARE A GENIUS!!
    So here is the code I have got so far:
    Code:
    SELECT HomeCareAgencies.*,MoCounties.ServicesOffered,MoCounties.Mnemonic,
                    ((SELECT DISTINCT County + ',' 
                          FROM MoCounties AS MC
                          WHERE MC.Mnemonic = HomeCareAgencies.Mnemonic
                          FOR XML PATH('')))AS MoCounty
    FROM         [HomeCareAgencies],MoCounties
    ...
    See more | Go to post

    Leave a comment:


  • @ Rabbit,

    I now have this statement:

    Code:
    SELECT     HomeCareAgencies.*,ILCounties.County,ILCounties.Mnemonic,ILCounties.Services,MoCounties.County,
              
                         ((SELECT',' + Services
                          FROM ILCounties AS ILC
                          FOR XML PATH('')))AS ILServicesAndCounties
                          
              
    FROM         HomeCareAgencies LEFT JOIN
    ...
    See more | Go to post

    Leave a comment:


  • @NeoPa and @Rabbit- Thank you both for your responses. I cant't combine the Counties tables because they are used in a different program independently. So that is one of the hurdles I have. I guess the main issue I am trying to resolve is, that if one of the Agencies provides 5 different services it list that agency 5 times. I need it to list the agency 1 time with all 5 services listed for that 1 agency. I think that is what @Rabbit is trying to...
    See more | Go to post

    Leave a comment:


  • Trying to do a COUNT/AS RANK and it will not work.

    Hello everyone! I am new to SQL and have given myself a 3 Day crash course! I apologize for my lack of knowledge. A project was assigned to me for work and so now I need to get it done.

    I am running SQL SERVER 2008. I have one Database. It is called "HomeHealth ". It has 3 Tables.

    1.HomeCareAgenc ies (Holds the Agency Information such as name, address, phone, as well as an ID that is called Mnemonic in the...
    See more | Go to post
    Last edited by zmbd; Feb 3 '13, 10:20 AM. Reason: [Z{Please use the <CODE/> formatting button to format your posted code and SQL}]
No activity results to display
Show More
Working...