Ver Mensaje Individual
  #2  
Antiguo 18-10-2005
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Reputación: 29
Lepe Va por buen camino
No comprendo eso de controlar un rango o dos rangos

la comparación que buscas es:
Código Delphi [-]
 if dtm.ADOTControl_fechas.FieldbyName('FECHA1').asDate >= defecha.date then

Por aqui tengo una rutina que tambien puede servirte:
Código Delphi [-]
uses dateutils;

{-----------------------------------------------------------------------------
  Procedure: DateInMonth
  Author:    Lepe
  Date:      11-mar-2005
  Arguments: TheDate:TDateTime; InMonthAndYear:TDateTime
  Result:    Boolean

  Comprueba si la fecha y hora en TheDate pertenece al mes y año indicado en
  InMonthAndYear.
-----------------------------------------------------------------------------}
function DateTimeInMonth(TheDate:TDateTime; InMonthAndYear:TDateTime):Boolean ;


implementation

function DateTimeInMonth(TheDate:TDateTime; InMonthAndYear:TDateTime):Boolean ;
var iniMes, finMes:TDateTime;
begin
  iniMes := RecodeDateTime(InMonthAndYear,
                            RecodeLeaveFieldAsIs,
                            RecodeLeaveFieldAsIs,
                            1,
                            0,0,0,0);
  finMes := RecodeDateTime(InMonthAndYear,
                            RecodeLeaveFieldAsIs,
                            RecodeLeaveFieldAsIs,
                            DaysInMonth(InMonthAndYear),
                            23,59,59,999);
  Result := (TheDate >= iniMes) and (TheDate <= finMes);
end;

bye bye
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.
Responder Con Cita