Good day, I need help please. I have a big store procedure that returns me the following table, I just need to use the returned data to divide the results in 2 grids, but I need to do it before return to client.
This is inside the procedure:
EXEC sp_executesql @sSQL
date client amount column1 column2 column3 ....lot of more columns
09-15-15 18ce 278 1 null 4
09-16-15 18ce 160 2 null 2
09-17-15 18ce 212 null 20 null
09-18-15 18ce 133 10 1 3
09-19-15 18ce 78 2 1 null
09-21-15 18ce 206 20 null 1
..in this moment, before return from store procedure I need to split results in 2 selects:
I need the records between 09-21-15 to 09-18-15 in the first recordset and a second recordset grouped by week with all the records, I need summarized amount, and column1 to columnxx, but I don't know the names of the column1 to columnxx so this is other of the problems.
1. Is it possible to handle the table returned in the same sp?
2. I need to return 2 tables from that one, first one the first three records ordered by date descending
3. second table to return, all the records ordered by date desc and grouped by week and all numeric columns summarized.
T.I.A.