Hi,
I have data in a worksheet with 3 columns:
group_name, group_order, and description
In my macro have the following code:
With TCode(i)
printToFile "INSERT INTO t_codes VALUES"
printToFile " ('" & .group_name & "', " & .group_order & ", '" & .description & "');" End With
which outputs to a file as:
INSERT INTO t_codes VALUES
(1, 0, 'red');
However, if one of the columns does not have data, e.g. description is blank,
the output is:
INSERT INTO t_codes VALUES
(1, 0, ' ');
where the description field now has a space as the value. When this file then is run into the database, the end result is incorrect...it *appears* there is data, i.e. a space, rather than a null value (hope that makes sense)
Is there any way I can remove this space value within in the printToFile?
Thanks,
cjg
Bookmarks