Extract a substring from a string, starting at a given position.

      Mid(string, start_position, [number_of_chars])

   string         The text string or string expression.

 start_position   The start character in the string.
                  The first character is 1.

 number_of_chars  The number of characters to extract.
                  default= all characters after start_position.

The Mid() function can be used in VBA or in an SQL query.


Dim strDemo as String
strDemo = Mid("The world is everlasting",5,5)
Returns "world"

“Love's dominion, like a king's, admits of no partition” ~ Ovid


Left - Extract a substring from a string
Right - Extract a substring from a string

© Copyright SS64.com 1999-2015
Some rights reserved