From 553ace8eb0fea9941cbb52267cedb4531f4b7c02 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 17 Oct 2017 15:09:55 -0400 Subject: [PATCH] dont convert to date if string is less than 6 long, also start adding commas at iteration 0 --- TheBigOne.cls | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/TheBigOne.cls b/TheBigOne.cls index 74512e2..c5203ed 100644 --- a/TheBigOne.cls +++ b/TheBigOne.cls @@ -2190,8 +2190,12 @@ Public Function SQLp_build_sql_values(ByRef tbl() As String, trim As Boolean) As type_flag(j) = "S" End If Else - If IsDate(tbl(j, 1)) Then - type_flag(j) = "D" + If Len(tbl(j, 1)) >= 6 Then + If IsDate(tbl(j, 1)) Then + type_flag(j) = "D" + Else + type_flag(j) = "S" + End If Else type_flag(j) = "S" 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) rec = "" - If i <> 1 Then sql = sql & "," & vbCrLf + If i <> 0 Then sql = sql & "," & vbCrLf rec = rec & "(" For j = 0 To UBound(tbl, 1) If j <> 0 Then rec = rec & ","