Erro ao Inserir data no BD
17/03/2013
0
qryInserir.Close; qryInserir.SQL.Clear; qryInserir.SQL.Add('Insert into cadhistoricomensagem '+ '(mensagem,data,hora,codfunc,qtd)'); qryInserir.SQL.Add('values ('+#39+ Memo1.Text+#39+',' + #39 + DateToStr(Date) + #39 +',' + #39 + TimeToStr(Time) + #39+',' + #39 + '1' + #39 +',' + #39 + '1' +#39+')'); qryInserir.ExecSQL; Incorrect date value: '17/03/2013' for column 'data' at row 1
Qual o formato de Data que tenho que passar ?
Grato.
Vander Carlos
Curtir tópico
+ 0
Responder
Posts
17/03/2013
Jaimar Soares
Você deve passar as datas entre pliques tbm..
Tenta passar da seguinte forma e ver se vai da certo:
A função QuotedStr, retorna a string que é informada como parametro entre aspas.
Ex: QuotedStr(01/01/13) resulta em '01/01/13'.
Tenta passar da seguinte forma e ver se vai da certo:
#39 + QuotedStr(DateToStr(Date)) + #39 +',' +
A função QuotedStr, retorna a string que é informada como parametro entre aspas.
Ex: QuotedStr(01/01/13) resulta em '01/01/13'.
Responder
Clique aqui para fazer login e interagir na Comunidade :)