Skip to Content
0
Former Member
Jun 14, 2007 at 05:30 PM

How to group and sort a DB-ResultSet

16 Views

Hello Developers,

I have a problem with the sorting of my query resultset.

I have a resultset like this:

f_date | ebit | quantity

-


2006-06-07 | 200.00 | 120

2006-06-08 | 220.00 | 114

2006-07-17 | 160.00 | 160

2006-07-27 | 210.00 | 190

2007-02-12 | 100.00 | 20

2007-04-13 | 500.00 | 220

2007-06-14 | 200.00 | 120

.... and so on

so I want to group by month ( Month ({rs.f_date}) ) so I get:

ebit quantity

month 2

2007 100.00 20

month 4

2007 500.00 220

month 6

2006 420.00 234

2007 200.00 120

month 7

2006 370.00 350

so I want to sort this table with the actuel month (today: 2007-06-14) to get this:

ebit quantity

month 6

2006 420.00 234

2007 200.00 120

month 7

2006 370.00 350

month 2

2007 100.00 20

month 4

2007 500.00 220