I have my crews form where you are adding personnel, but when they are shown in the datagridview, I do not want them to show me all, but only one record per page.
Here is an example of this:
Then group it by the folio number as follows:
GROUP BY Folio, Nombre_de_la_cuadrilla
What this does, because it groups all the folios with the same name as the cuadrilla.
It's worth saying
If your query is the following:
SELECT FOLIO, NOMBRE_CUADRILLA
FROM MYTABLA;
I would show something like this:
____________________________________________________
| FOLIO | NOMBRE_CUADRILLA |
___________________________________________________
| MOC. 00001 | 3 albañiles + 3guardias de seguridad|
| MOC. 00001 | 3 albañiles + 3guardias de seguridad|
| MOC. 00001 | 3 albañiles + 3guardias de seguridad|
| MOC. 00002 | 2 mecanico + 2 ayudantes general |
| MOC. 00002 | 2 mecanico + 2 ayudantes general |
| MOC. 00002 | 2 mecanico + 2 ayudantes general |
___________________________________________________
If you put GROUP BY
in the following way
SELECT FOLIO, NOMBRE_CUADRILLA
FROM MYTABLA
GROUP BY FOLIO, NOMBRE_CUADRILLA;
The result would be:
____________________________________________________
| FOLIO | NOMBRE_CUADRILLA |
___________________________________________________
| MOC. 00001 | 3 albañiles + 3guardias de seguridad|
| MOC. 00002 | 2 mecanico + 2 ayudantes general |
___________________________________________________
I hope you can solve your case. Success!
to your query add the following
GROUP BY Folio
this should solve your problem