Showing posts with label titles. Show all posts
Showing posts with label titles. Show all posts

Tuesday, March 27, 2012

Combining strings

Let's assume we have two tables - Customers and Orders.

I need a query that will return a string value containing a list of order titles from the Orders table for a particular customer.

How can this be done?

Thanks.

Hi vkh,

you have to use a function approach for this, as it can be seen on (sort of, I would vary this one to a temporary table rather than a cursor, but just to show you the iterative approach)

http://www.sqlteam.com/item.asp?ItemID=2368

HTH; jens Suessmeyer.

|||Thank you!

Saturday, February 25, 2012

Column Number function in a matrix?

I have a matrix and would like to be able to add to the column titles
the column number. I have been looking for a function maybe similar
to the rownumber() function, but cannot locate anything for column
number. Is this a possibility?
Thanks!On Jun 26, 6:42 pm, Just Another Reporter <Crystal.War...@.gmail.com>
wrote:
> I have a matrix and would like to be able to add to the column titles
> the column number. I have been looking for a function maybe similar
> to the rownumber() function, but cannot locate anything for column
> number. Is this a possibility?
> Thanks!
The best way to add this functionality is to add an extra column to
your dataset (query/stored procedure results) giving the column rank
(so to speak). If there are a manageable number of column values to
pivot, you can use case statements in the query/stored procedure to
assign the column rank value. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant