PARA COMPARAR DOS HORAS?
Publicado por EFRAIN (29 intervenciones) el 12/08/2004 16:51:31
Hola amigos, gracias por sus respuestas, pero podrías ser un poco mas especifico por que no entiendo bien y disculpen. Este es el codigo que me dieron para comparar una fecha, y es exactamente lo que necesito, pero tambien necesito comparar dos horas de la misma manera. Les agradezco de antemano tu ayuda.
If CDate(txtFECHA) > Date Then
Label1.Caption = "LA FECHA INTRODUCIDA ES POSTERIOR"
ElseIf CDate(txtFECHA) = Date Then
Label1.Caption = "LA FECHA INTRODUCIDA ES HOY"
Else
Label1.Caption = "LA FECHA INTRODUCIDA ES ANTERIOR"
End If
Lo de aumentar la hora es por que necesito que el usuario inserte una hora y luego yo necesito adelantarla en cuatro horas, o tambien necesito saber partiendo de una hora tal, que hora sera dentro de 1 hora y 30 minutos exactamente.
Yo probe asi y no me sirvio
If time(txtHORA) > time Then
Label1.Caption = "LA HORA INTRODUCIDA ES POSTERIOR"
ElseIf time(txtHORA) = time Then
Label1.Caption = "LA HORA INTRODUCIDA ES YA"
Else
Label1.Caption = "LA HORA INTRODUCIDA ES ANTERIOR"
End If
If CDate(txtFECHA) > Date Then
Label1.Caption = "LA FECHA INTRODUCIDA ES POSTERIOR"
ElseIf CDate(txtFECHA) = Date Then
Label1.Caption = "LA FECHA INTRODUCIDA ES HOY"
Else
Label1.Caption = "LA FECHA INTRODUCIDA ES ANTERIOR"
End If
Lo de aumentar la hora es por que necesito que el usuario inserte una hora y luego yo necesito adelantarla en cuatro horas, o tambien necesito saber partiendo de una hora tal, que hora sera dentro de 1 hora y 30 minutos exactamente.
Yo probe asi y no me sirvio
If time(txtHORA) > time Then
Label1.Caption = "LA HORA INTRODUCIDA ES POSTERIOR"
ElseIf time(txtHORA) = time Then
Label1.Caption = "LA HORA INTRODUCIDA ES YA"
Else
Label1.Caption = "LA HORA INTRODUCIDA ES ANTERIOR"
End If
Valora esta pregunta


0