# Database Discussions > Sybase >  While Loop

## vcs1161

I am struggling with the right loop code for my query.  My data table resembles this example.

Table A
Cust_ID ,
Date,
Item_Num

So Table A will have the same Item_Num for the same Cust_ID but for different dates.  I would like to build an array in one calculated field of the different dates.  So the output would look like:

Cust_ID       Item_Num     Item_Dates
1	           2        1/1/2011, 2/14/2011, 3/6/2011
2                      2          3/14/2011
3                      2          2/23/2010, 3/1/2011

Any help is greatly appreciated.

----------

