Link to home
Create AccountLog in
Avatar of Aleks
AleksFlag for United States of America

asked on

Stuff data into one record

I have the query below, that displays the results like this:

User generated image
What I need in the results is something like:

 lastnm                            firstnm              licensenum            licensestate
 Perez/Mucino               Juan/Aleks        423323/1234           Texas/Florida

Which is basically putting the results of both records and stuffing them into one record separated by a  '/'  sign.

How can I do this ?

I am using MS SQL 2008R2 and classic ASP.

Here is my current query which returns two or more rows (rarely more than two). I would probably be happy if it takes the top two records and stuffs them into one separated by '/'

SELECT   b.MaidenNm AS lastnm,
        b.MailStr AS firstnm,
        b.MajFldStudy AS licensenum,
        b.Pob licensestate
FROM    dbo.Atts AS a
        INNER JOIN Users b ON a.UserId = b.UserId
        LEFT JOIN dbo.FirmAddresses AS c ON c.Id = b.FirmAddressIdcon
WHERE   b.UserType = 'attorney'
        AND a.Xfer2Forms = 1
        AND a.CaseId = 11318
ORDER BY a.Ordernumatts ,
        b.MailStr;

Open in new window

SOLUTION
Avatar of Russell Fox
Russell Fox
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Avatar of Chris Luttrell
Chris Luttrell
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of Aleks

ASKER

Followed up on a different post.
Please request that this thread be deleted.  At the very least my comment should not be considered a solution by any stretch of the imagination.