VB6 data report: Grouping using the Group By statement, without the data environment

StackOverflow https://stackoverflow.com/questions/21322508

  •  02-10-2022
  •  | 
  •  

Frage

I can accomplish the grouping in Data Report using the Data Environment smoothly. But I want to create the grouping via code using the GROUP BY statement.

I have this code but an error occurs saying Report sections do not match data source.

SELECT 
G.Code, G.Description, COUNT(E.EmpNo), COUNT(E.EmpName) FROM tblEmployee E
INNER JOIN tblEmployeeGroups EG
ON E.EmpNo=EG.EmpID
INNER JOIN tblGroup G
ON EG.GroupID=G.Code
GROUP BY G.Code, G.Description
ORDER BY G.Code ASC

Is it only possible to accomplish this via Data Environment?

War es hilfreich?

Lösung

Rewrite your query to use the Data Shaping Provider. This has a SQL-like SHAPE command for creating hierarchical rowsets

That is what the Data Environment does under the covers.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top