# `Fun_GetTestMaterialsCount` (function) > 获取字符串中数字 - **Type:** FUNCTION - **Returns:** `int` - **Deterministic:** NO - **SQL data access:** CONTAINS SQL ## Parameters | # | Mode | Name | Type | |---|---|---|---| | 1 | IN | `tCreateDate` | `datetime` | | 2 | IN | `sMaterialsId` | `varchar(100)` | ## Body _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE FUNCTION `Fun_GetTestMaterialsCount`'`._ ## Narrative **Business context:** Per-material sample-order monthly counter — sibling of [`Fun_GetTestCount`](Fun_GetTestCount.md). Counts how many sample-order (`sOrderType=5`) line rows reference a given material `sId` within the calendar month of `tCreateDate`. Used to gauge per-material 打样 frequency. The header comment `获取字符串中数字` is wrong/copy-pasted from `Fun_GetNum`. **What it does:** joins `salsalesorderslave` to `salsalesordermaster`, filters `sOrderType=5`, `sMaterialsId=sMaterialsId`, and the same `[YYYY-MM-01, next-month-01)` month window. Counts `sId`. **Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit.