Ver Mensaje Individual
  #2  
Antiguo 19-06-2012
Avatar de RONPABLO
[RONPABLO] RONPABLO is offline
Miembro Premium
 
Registrado: oct 2004
Posts: 1.514
Reputación: 21
RONPABLO Va por buen camino
Podría ser una tabla que tenga tres campos smallInt (Mes, Dia, Tiempo)


Cita:
Tabala

Mes Dia Tiempo
1 1 89
1 2 89
1 3 89
..
..
..
1 29 89
1 30 89
1 31 90
Luego solo sería hacer consultas tales como
Código SQL [-]
Select Tiempo From Tabla where Dia = :dia and Mes = :Mes



Y luego en delphi podría hacer algo como esto:
Código Delphi [-]
Function fRetornarTiempo(Dia, Mes : Integer) : Integer; 
begin
    QConsultarTiempoXDiaYMes.close;
    QConsultarTiempoXDiaYMes.ParamByName('Dia').asIntiger := Dia;
    QConsultarTiempoXDiaYMes.ParamByName('Mes').asIntiger := Mes;
    QConsultarTiempoXDiaYMes.Open;
    if QConsultarTiempoXDiaYMes.RecordCount > 0 then
       Result := QConsultarTiempoXDiaYMes.FIeldByName('tiempo').asInteger
    else
       Result := -1; 
   QConsultarTiempoXDiaYMes.close;
 end;
__________________
"Como pasa el tiempo..... ayer se escribe sin H y hoy con H"
Responder Con Cita