In VB you can get characters form a specified place form a string with mid function. Is there a similar function in SQL?
thanks
Jamppa
Printable View
In VB you can get characters form a specified place form a string with mid function. Is there a similar function in SQL?
thanks
Jamppa
Depends on the SQL. Transact-SQL (used by MS SQL Server) has a "charindex" function that appears to behave as "mid" does.
Standard SQL does not, I believe, have this ability.
The Mid function can be used embedded into your SQL query if using DAO and connecting to Access.
Using the following example would return all records where the name field contains the text 'ill' in character positions 2,3, and 4.
Data1.RecordSource = "Select * from MyTable Where Mid(Name,2,3) = 'ill'"
Data1.Refresh
So records with the name 'Bill' and 'Jill' would be returned. Don't forget you may also need to embed a UCASE to avoid case senstivity.