rui_fernandes Posted October 15, 2007 at 02:26 PM Report Share #140192 Posted October 15, 2007 at 02:26 PM boas...e o seguinte, tenho uma QUERY, em que concateno campos preenchidos, (isto em VB), mas nos campos do tipo moeda, se o valor tiver VIRGULA, da-me erro... "INSERT INTO tabela (codigo,Valor) VALUES (" & CODIGO & "," & VALOR & "); VARIAVEIS : CODIGO = 1 VALOR = 10,55 QUERY unida vai dar o seguinte..... "INSERT INTO tabela (codigo,Valor) VALUES (1,10,55); nao, existe maneira de "separar" cada campo , com () ou kk outra coisa....porque assim fica com mais um campo para inserir... ja testei com os () , mas tenh de meter pelicas, e o valor guardado fica negativo.... 😉 Rui Fernandes Link to comment Share on other sites More sharing options...
seesharptec Posted October 15, 2007 at 02:35 PM Report Share #140195 Posted October 15, 2007 at 02:35 PM Tens de por "INSERT INTO tabela (codigo,Valor) VALUES (1,"10,55"); Mas tens de ter o campo valor definido como double e duas casa decimais SeeSharpTec Link to comment Share on other sites More sharing options...
Tiago Salgado Posted October 15, 2007 at 03:00 PM Report Share #140200 Posted October 15, 2007 at 03:00 PM Rui, ganha se é VB.NET, começa a habituar-te a usar os parametros. Algo do tipo Dim cmd as SqlCommand = New SqlCommand("INSERT INTO tabela(codigo,valor) VALUES(@codigo,@valor)") cmd.Parameters.AddWithValue("@codigo,"1") cmd.Parameters.AddWithValue("@valor","10,55") Cumps Link to comment Share on other sites More sharing options...
M6 Posted October 15, 2007 at 08:49 PM Report Share #140287 Posted October 15, 2007 at 08:49 PM Modo geral, nas bds o símbolo separador dos valores numéricos, é o .. 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar." Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now