Code Snippet Details

<- Back to List


Language
VBA
Description
Split SQL statement
Code
Private Sub SplitSql() Dim ssql As String ssql = "SELECT col1, col2, " & _ " col3" & _ " FROM tablename " & _ " WHERE col2 = " PrintSplitValue ssql End Sub Private Sub PrintSplitValue(ByVal value As String) Dim lines() As String Dim id As Integer lines() = Split(value, ",") For id = 0 To UBound(lines()) Debug.Print Replace(lines(id), " ", "") Next id End Sub