Hello Team,
Please guide me in the following -
| ID | Location | CertifiedBy | CertifiedOn | Month | Year |
| 1 | Gujarat | Riddhi.Valecha | 14-03-2023 14:07 | 4 | 2023 |
| 2 | Karnataka | Riddhi.Valecha | 14-04-2023 14:27 | 4 | 2023 |
| 3 | Haryana | Riddhi.Valecha | 14-04-2023 14:35 | 4 | 2023 |
| 4 | Gujarat | Riddhi.Valecha | 14-03-2023 14:07 | 4 | 2023 |
| 5 | Gujarat | Riddhi.Valecha | 14-04-2023 14:27 | 4 | 2023 |
| 6 | Gujarat | Riddhi.Valecha | 14-04-2023 14:35 | 4 | 2023 |
| 7 | Gujarat | Riddhi.Valecha | 14-03-2023 14:07 | 4 | 2023 |
| 8 | Karnataka | Riddhi.Valecha | 14-04-2023 14:27 | 4 | 2023 |
| 9 | Haryana | Riddhi.Valecha | 14-04-2023 14:35 | 4 | 2023 |
| 10 | Gujarat | Riddhi.Valecha | 14-03-2023 14:07 | 4 | 2023 |
| 11 | Karnataka | Riddhi.Valecha | 14-04-2023 14:27 | 4 | 2023 |
| 12 | Haryana | Riddhi.Valecha | 14-04-2023 14:35 | 4 | 2023 |
I need the output as below -
| Stock Location | Stock Owner | Date : DD/MMM/YYYY HH:MM |
| Total Stock | ||
| Gujarat | Riddhi Valecha | 6 |
| Karnataka | Riddhi Valecha | 3 |
| Haryana | Riddhi Valecha | 3 |
Please help me out in making the query and making this in GridView in Front-End.
Jignesh KumarPosted Apr 19, 2023, 8:20 AM
Hello Ridhi,
Please try this one,
Amit MohantyPosted Apr 19, 2023, 8:41 AM
Try this
Naimish MakwanaPosted Apr 18, 2023, 3:28 PM
Use below query.
Thanks
Tuhin PaulPosted Apr 18, 2023, 3:07 PM
In my above code Replace "your_connection_string_here" with your SQL Server connection string, and "your_query_here" with the SQL query from above. Replace "yourGridView" with the ID of your GridView control.
Tuhin PaulPosted Apr 18, 2023, 3:06 PM
Assuming you have a SQL Server database table named "Certifications" with the columns "ID", "Location", "CertifiedBy", "CertifiedOn", "Month", and "Year", you can use the following SQL query:
This query will group the certifications by location, certified by, and certified on date and time, and count the number of certifications for each group. The WHERE clause filters the results to only include certifications from April 2023.
To display the query results in a GridView in the front-end, you can bind the GridView to a DataTable filled with the query results.