Fórum Data de Aniversário com AdoQuery #329478
15/09/2006
0
Query.Close; Query.SQL.Clear. Query.SQL.Add(´Select * from TabelaAlunos where EXTRACT(MONTH from DataAniver) = :MES´); Query.ParamByName(´MES´).AsInteger := StrToInt( FormatDateTime( ´MM´,Date ) ); Query.Open;
Obrigado.
Ranyeryfip
Curtir tópico
+ 0Posts
15/09/2006
Rjun
Só fazendo uma correção. O correto é
Query.Parameters.ParamByName
Gostei + 0
15/09/2006
Motta
extract day from .... = :dia
Gostei + 0
15/09/2006
Output
var ano, mes, dia: word; begin DecodeDate(now, ano, mes, dia); qry.Close; qry.SQL.Clear; qry.SQL.Add(´Select * from Clientes WHERE Day(Data_Nasc) = ´ + ´´´´ + IntToStr(dia) + ´´´´); qry.SQL.Add(´ and Month(Data_Nasc) = ´ + ´´´´ + IntToStr(mes) + ´´´´); qry.Open; if not qry.isEmpty then begin ShowMessage(´Hoje tem aniversariantes. Confira!´); end;
Gostei + 0
15/09/2006
Ranyeryfip
Muito obrigado pela a ajuda, consegui resolver meu problema.
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)