Hi there,

I'm struggling to select all "cOperationId" from the Table and get their combined sum by name and sum.

I know how to query 1 by 1, but is there any solution to get all and list them?

Code:
Dim Sql, stDevId

stDevId = "NPRCS-003"

Sql = "SELECT COALESCE(SUM(cQuantity), 0) AS total FROM AppBlackBoxData WHERE cDeviceId='" & stDevId & "' AND cDate=CURDATE()"

Set Rs = Db.Execute(Sql)

Response.Write(Rs.Fields("total").Value)
The database table looks like this:
Name:  vb-sql-db-table.png
Views: 543
Size:  28.4 KB

I would like to have output like this for example:
Code:
SW0001 = 1
SW0002 = 2
SW0003 = 3
PK0004 = 7
Any help would be appriciated,

Kind regards,
Viktor