amorosik
Member
- Local time
- Today, 20:53
- Joined
- Apr 18, 2020
- Messages
- 517
I have an in-memory Ado recordset that contains four lines of the type
Value Code
100.00 1234
200.00 1234
300.00 3456
400.00 5678
I would like to get a recordset so that the 'Value' field is the sum and grouped by Code, and then something like this
Value Code
300.00 1234 <- sum of 100.00 + 200.00 of the same Code 1234
300.00 3456
400.00 5678
If I had the data on a table, a select like this would suffice
"select sum(Value), Code from TableName group by Code"
But having only one recordset in memory as input parameter, how can I get a second recordset containing the result like the example described above?
Value Code
100.00 1234
200.00 1234
300.00 3456
400.00 5678
I would like to get a recordset so that the 'Value' field is the sum and grouped by Code, and then something like this
Value Code
300.00 1234 <- sum of 100.00 + 200.00 of the same Code 1234
300.00 3456
400.00 5678
If I had the data on a table, a select like this would suffice
"select sum(Value), Code from TableName group by Code"
But having only one recordset in memory as input parameter, how can I get a second recordset containing the result like the example described above?