Campo Data Delphi X MySql
Olá Pessoal !!!
Estou fazendo uma consulta com datas no MySql e nao esta me retornando erro e nem resultado nenhum....
Sei que no Access temos que utilizar #, alguem sabe como pesquisar com data no mysql 5....
wdat1:=´2006-08-01´
wdat2:=2006-12-31´
QryConsulta.Sql.Add(´ and C2.DataPgto Between ´+wdat1+´ and ´+wdat2+´´)
Obrigado.
Robson.
Estou fazendo uma consulta com datas no MySql e nao esta me retornando erro e nem resultado nenhum....
Sei que no Access temos que utilizar #, alguem sabe como pesquisar com data no mysql 5....
wdat1:=´2006-08-01´
wdat2:=2006-12-31´
QryConsulta.Sql.Add(´ and C2.DataPgto Between ´+wdat1+´ and ´+wdat2+´´)
Obrigado.
Robson.
Robsons
Curtidas 0
Respostas
Bon Jovi
27/08/2006
Vc esqueceu de colocar entre aspas simples. QuotedStr faz isso.
wdat1 := QuotedStr(´2006-08-01´);
wdat2 := QuotedStr(´2006-12-31´);
wdat1 := QuotedStr(´2006-08-01´);
wdat2 := QuotedStr(´2006-12-31´);
GOSTEI 0