August 3, 2006 at 3:00 am
Good day,
I have a stored proc that returns information pertaining to orders, and this gets run through a report. If the order info has more than 1 hold type (credit hold or direct hold) then the report duplicates the order info for each of these hold types.
I want to be able to combine these 2 or more hold types into the same row, so instead of there being 2 rows (1 with credit hold and 1 with direct hold) there should be 1 row for the specific item number, with the results being presented like credit hold/direct hold.
Anybody have any ideas on what i can do?
Thanks!
August 3, 2006 at 3:23 am
August 7, 2006 at 9:44 am
check out http://www.sqlservercentral.com/columnists/cherring/replacingcursorsandwhileloops.asp
specifically the Replacing the Outer Cursor code sample. The code needs a local variable to hold the strings, but you can concatenate the whole list into a single field.
August 7, 2006 at 6:39 pm
Post your table structure with sample data. It is difficult for us to advice you without knowledge of your structure
August 7, 2006 at 11:35 pm
case when MIN(Type) = MAX(Type) then MIN(Type) else Min(type) + '/' + MAX(Type) end
_____________
Code for TallyGenerator
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply