I have a number generation script which queries for the max value of a
pattern using:- sSql = "select max (CN_DOCUMENT_NUMBER) MaxNr from
tn_Documentation where CN_DOCUMENT_NUMBER Like '" & sPrefix & "%' "
Typical Documen Number values are OSI_PROG_001, OSI_PROG_002, OSI_PR_001 etc
I then increment the final numeric by 1. When creating a new record where
the query knows that sPrefix = "OSI_PROG_" and that for another new record
sPrefix = "OSI_PR_" (note the underscore at the end is included in sPrefix,
it still won't allow a second PR to be made as the query finds "PROG"
I understand that this is due to the underscore character being the single
digit wildcard for SQL syntax.
Any ideas how to resolve this?