Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   SQL (https://www.clubdelphi.com/foros/forumdisplay.php?f=6)
-   -   Como consultar un campo timestamp teniendo un dato de tipo date? (https://www.clubdelphi.com/foros/showthread.php?t=56554)

CharlesWar 20-05-2008 18:55:49

Como consultar un campo timestamp teniendo un dato de tipo date?
 
utilizo delphi ver.7. y base de datos paradox ver.7

Fecha_Apli es de tipo TimeStamp, Fecha1 y Fecha 2 son objetos tdatetimepicker.

Código SQL [-]
q_cobranza.SQL.Add ('Select * from Cuen01 where FECHA_APLI>=' + QuotedStr(datetostr(fecha1.Date)) + ' and FECHA_APLI<= ' + QuotedStr(datetostr(fecha2.Date))) ;





esto me produce el sig. error = "Type mismatch in expression"

Agredeceria la ayuda he intentado usando la funcion convert y tampoco me funciona.:(

poliburro 07-06-2008 02:12:36

Código Delphi [-]

q_cobranza.SQL.text := 
   '  Select * from Cuen01 where FECHA_APLI > "' +  
    Formatdatetime('yyyy/mm/dd',fecha1.Date) + '" And ' + 
   ' FECHA_APLI<= "' +  Formatdatetime('yyyy/mm/dd',fecha2.Date + '"' ;

CharlesWar 18-06-2008 17:51:27

Gracias Poliburro formatdatetime era la solucion. :)


La franja horaria es GMT +2. Ahora son las 11:54:03.

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