I have values in Excel spreadsheets that I would like to format for creating INSERT statements to be run in SQL.
Based on whether a column heading value is C for Character or N for numeric, the value would either apostrophe before and after the value or no apostrophes if it is numeric.
[Sorry, don't know how to paste image.]
<tbody>
</tbody>
Based on whether a column heading value is C for Character or N for numeric, the value would either apostrophe before and after the value or no apostrophes if it is numeric.
[Sorry, don't know how to paste image.]
I am looking for function - CREATEINSERT for example - that would create the values inside the individual | |||||
values inside the parenthesis based on the values in row 6 which has C and N. | |||||
=CREATEINSERT($B6,B8) would produce '01001' while | |||||
=CREATEINSERT($E6,E8) would produce '55347'. | |||||
C | C | C | N | N | |
COUNTIES | COUNTYFIPS | STATEABBR | COUNTYNAME | POP2015 | AREASQMI |
INSERT INTO COUNTIES VALUES ('01001','AL','Autauga County',55347,594.436); | 01001 | AL | Autauga County | 55347 | 594.436 |
INSERT INTO COUNTIES VALUES ('01003','AL','Baldwin County',203709,1589.784); | 01003 | AL | Baldwin County | 203709 | 1589.784 |
INSERT INTO COUNTIES VALUES ('01005','AL','Barbour County',26489,884.876); | 01005 | AL | Barbour County | 26489 | 884.876 |
INSERT INTO COUNTIES VALUES ('01007','AL','Bibb County',22583,622.582); | 01007 | AL | Bibb County | 22583 | 622.582 |
INSERT INTO COUNTIES VALUES ('01009','AL','Blount County',57673,644.776); | 01009 | AL | Blount County | 57673 | 644.776 |
INSERT INTO COUNTIES VALUES ('01011','AL','Bullock County',10696,622.805); | 01011 | AL | Bullock County | 10,696 | 622.805 |
<tbody>
</tbody>
Last edited: