Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   MySQL (https://www.clubdelphi.com/foros/forumdisplay.php?f=21)
-   -   Problemas con select en campo fecha (https://www.clubdelphi.com/foros/showthread.php?t=47646)

sancarlos 04-09-2007 03:01:25

Problemas con select en campo fecha
 
Gracias....

Tengo un campo fecha en la base de datos mysql tipo date.
y esta clausula con delphi 7

f.Close;
f.SQL.Clear;
f.SQL.Add('select factura,fecha from facturas');
f.SQL.Add('where fecha='+chr(39)+datetostr(fecha.Date)+chr(39)+'');
f.open;

pero no pasa nada , no me manda ningun error.

poliburro 04-09-2007 04:19:07

Prueba de esta manera


Código Delphi [-]
Query.Close;
Query.Sql.Text := 
    '  select factura, fecha ' +
    '    from facturas ' +
    '  where fecha = "' + FormatDateTime('yyyy-mm-dd',Fecha.Date) + '"';
Query.Open;


La franja horaria es GMT +2. Ahora son las 01:33:42.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi