dont convert to date if string is less than 6 long, also start adding commas at iteration 0

This commit is contained in:
Paul Trowbridge 2017-10-17 15:09:55 -04:00
parent 30e20bc420
commit 553ace8eb0

View File

@ -2190,8 +2190,12 @@ Public Function SQLp_build_sql_values(ByRef tbl() As String, trim As Boolean) As
type_flag(j) = "S" type_flag(j) = "S"
End If End If
Else Else
If IsDate(tbl(j, 1)) Then If Len(tbl(j, 1)) >= 6 Then
type_flag(j) = "D" If IsDate(tbl(j, 1)) Then
type_flag(j) = "D"
Else
type_flag(j) = "S"
End If
Else Else
type_flag(j) = "S" type_flag(j) = "S"
End If End If
@ -2201,7 +2205,7 @@ Public Function SQLp_build_sql_values(ByRef tbl() As String, trim As Boolean) As
For i = 0 To UBound(tbl, 2) For i = 0 To UBound(tbl, 2)
rec = "" rec = ""
If i <> 1 Then sql = sql & "," & vbCrLf If i <> 0 Then sql = sql & "," & vbCrLf
rec = rec & "(" rec = rec & "("
For j = 0 To UBound(tbl, 1) For j = 0 To UBound(tbl, 1)
If j <> 0 Then rec = rec & "," If j <> 0 Then rec = rec & ","