I'm fairly certain that SQL Server doesn't understand date literals like that. That would work for Access but different databases require different syntax. You should use text literals in yyyy-MM-dd format:
"' AND added_date BETWEEN '2020-07-21 00:00:00' AND '2020-07-21 23:59:59'"
That said, I'm guessing that you're going to have to vary those dates at some point, so you probably ought to be using parameters. You definitely should be using a parameter for the it_code value, e.g.
Dim sql = "SELECT sum(purchase_qty) FROM TB_STOCK WHERE it_code = @it_code AND added_date BETWEEN @added_date_start AND @added_date_end"
Dim command As New SqlCommand(sql, connection)
With command.Parameters
.Add("@it_code", SqlDbType.VarChar, 50).Value = itCode
.Add("@added_date_start", SqlDbType.DateTime).Value = myDate
.Add("@added_date_end", SqlDbType.DateTime).Value = myDate.AddDays(1).AddSeconds(-1)
End With
I agree with Rodney Ellis about not using BETEWEEN too. I would do it like this:
Dim sql = "SELECT sum(purchase_qty) FROM TB_STOCK WHERE it_code = @it_code AND added_date >= @added_date_start AND added_date < @added_date_end"
Dim command As New SqlCommand(sql, connection)
With command.Parameters
.Add("@it_code", SqlDbType.VarChar, 50).Value = itCode
.Add("@added_date_start", SqlDbType.DateTime).Value = myDate
.Add("@added_date_end", SqlDbType.DateTime).Value = myDate.AddDays(1)
End With
The last two examples both assume that myDate already has the time zeroed. If it doesn't, you can use myDate.Date.