Link to home
Start Free TrialLog in
Avatar of gringotani
gringotani

asked on

Access query:contantenate "page number" if part ID filed is duplicate

Hi, Please give me the SQL  to concatenate the page# with a comma, if the part ID is a duplicate.  in the  examples below, I would like to see widget_001 only display 1 row and to concatenate pages "2" and "10"  as  " 2, 10"  

example of non concatenate:            
      A                     B
1      part_ID      page#
2      widget-001      2
3      widget-001      10
4      widget-002      6`
5      widget-003      50
           
           
desired results:            
      A                   B
1      part_ID      page#
2      widget-001      2, 10
4      widget-002      6`
5      widget-003      50


SELECT C.PART_ID, C.[PAGE #]
FROM C;

Open in new window

Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Can't be done in Jet SQL.

You have to write code to do the concatenation.
Avatar of gringotani
gringotani

ASKER

I want to do it in Access. what is the SQL code?
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial