1

I am working with Microsoft Office Professional Plus 2010. What I am trying to figure out is how to merge all characters for each DOMAIN field into one row, for example:

Q01                         DOMAIN      Q32
-----------------------------------------------
http://redbull.example.com  example.com F
http://www.example.com      example.com B

What I would like to accomplish through a query is to take the DOMAIN field and create a view which merges the "Q32" into one row, for example:

DOMAIN      Q32
----------------
example.com B F

Is this possible through a design query or would I have to write a SQL statement? I tried the following SQL statement to create a UNION with two different tables, though I still didn't get the merge displayed correctly.

SELECT DOMAIN, Q32
FROM tblMERGE
UNION
SELECT DOMAIN, Q32
FROM tblASSET;

1 Answer 1

1

If you have not more than 2 values for domain, this will help:

SELECT [DOMAIN], IIF(First([Q32])<>Last([Q32]), First([Q32])+' '+Last([Q32]),First(Q32)) AS _Q32
FROM [table]
GROUP BY [DOMAIN];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.