What is the method of calling custom function in access query?
You can directly call custom functions in Access queries, which can help us solve some special query statistics in actual work.
(Related recommendations: access database learning)
Example:
Q: How to count the number of times certain words appear in lyrics?
Step 1: Create a table
See the figure below for the specific table
The specific functions are as follows. There is a knowledge point here, which is the Split function. We will talk about this later, but I will mention it here first.
[code=vb] Public Function WordFrequency(ByVal Lyric As String, ByVal Word As String) As String Dim arr As Variant Dim brr As Variant Dim i As Long Dim countChar As Long If Lyric = “” Or Word = “” Then Exit Function If InStrRev(Word, “|”) = 0 Then Exit Function arr = Split(Word, “|”) For i = 0 To UBound(arr) - 1 brr = Split(Lyric, arr(i)) countChar = UBound(brr) - LBound(brr) WordFrequency = WordFrequency & ““” & arr(i) & “”” & “出现次数:” & countChar & vbCrLf Next i End Function [/code]Step 3: Build a queryFor specific queries, let’s look at the screenshot below
SELECT song title, lyrics, word segmentation, WordFrequency([lyrics],[word segmentation]) AS word frequency FROM Table 2;Finally, let’s take a look at the running results
The above is the detailed content of What is the method of calling custom function in access query?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Chinese version
Chinese version, very easy to use

SublimeText3 Linux new version
SublimeText3 Linux latest version

Zend Studio 13.0.1
Powerful PHP integrated development environment