Sure you can dynamically build a command. It sounds like you're creating dynamic SQL though; so none of the SQL queries can be predefined in advanced? If not, you can use string manipulation or regular expressions to parse apart the SQL string.
strSQL = strSQL.Substring(0, strSQL.indexOf(" WHERE "))
' \. means any characters, and the + means one or more
strSQL = Regex.Replace(strSQL, " WHERE \.+", "")
Something like that,