Activity 10.02 – Creating a function and calling it
As part of your project to convert the MS Access application to MySQL, you have reviewed the SQL 6
SQL statement and have determined that the statement should be converted to a MySQL function to force the processing to the MySQL server, simplify the VBA code, and ensure there is only a single value returned.
You will be working with the code tagged as SQL 6
. In this activity, you will create a function to count and assign the total groups to the cntGroups
textbox. Follow these steps to complete this activity:
- Copy the
Create Function fnCountSeries.sql
file used in the previous exercise and name the new fileCreate Function fnCountGroups.sql
.Note
The
Create Function fnCountSeries.sql
file can be found here:https://github.com/PacktWorkshops/The-MySQL-Workshop/tree/master/Chapter10/Exercise10.02
- Modify the new file to create a function named
fnCountGroups
. - Use the original SQL statement from VBA. Make a slight...