I have a data in Excel that want to insert into SQL.
There are rows that have a blank, when I try to insert the data into SQL, the data is inserted as '0' instead of 'NULL'.
Example of data as below:
---------------------------------
Items Total Price
---------------------------------
Glue 4 $1
Socks 2 $7
Tumbler $40
Pen 10 $1
Eraser $0.5
---------------------------------
Items(char(50))
Total(int)
Price(float)
Does anyone know how can I insert the blank data as NULL instead of "0" ?
Below is what I have so far.
STRSQL = "INSERT INTO [Stationary].[dbo].[Stocks] ([Items],[Total],[Price])" & _
"VALUES ('" & Range("A" & i) & "','" & Range("B" & i) & "','" & Range("C" & i) & "')"
Really appreciate if anyone can help me on this.