SQL string

  • Thread starter Thread starter kon
  • Start date Start date
K

kon

How can I insert into a table value witch is
for example 12,3 while it takes it as 2 different values in a sql string (I
don't wont the value to converted to string but keep is as double)

Thank in advace
 
Show us what you're trying to use now. That will help us see what you're
doing and what might need to be changed.
 
Dim codecustomer, sqlstring As String
codecustomer = rslist.Fields("code")
sqlstring = " INSERT INTO difference ( custcode, residual,
total ) values ('" & codecustomer & "'," & residual & "," & total & ")"
DoCmd.RunSQL sqlstring
Residual or total might be 12,2 so it takes as 2 values
How can I change my sqlstring to bypass the problem?
 
Enclose the values inside ' characters:

sqlstring = " INSERT INTO difference ( custcode, residual,
total ) values ('" & codecustomer & "', '" & residual & "', '" & total &
"')"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top