Visual Basic - COMO COMPARAR DOS FECHAS

Life is soft - evento anual de software empresarial
 
Vista:

COMO COMPARAR DOS FECHAS

Publicado por EFRAIN (29 intervenciones) el 10/08/2004 23:25:50
SALUDOS A TODOS. CUAL ES EL CODIGO PARA COMPARAR DOS FECHAS, ES DECIR SI PISO UN BOTON QUE ME COMPARE DOS FECHAS Y DOS HORAS Y ME DIGA CUAL ES ANTERIOR O POSTERIOR.

LO HE HECHO ASI Y NO ME SIRVE

IF VAL(txtFECHA.TEXT) > DATE THEN
LABEL1.TEXT = " LA FECHA INTRODUCIDA ES POSTERIOR"
ELSE
LABEL1.TEXT=" LA FECHA INTRODUCIDA ES ANTERIOR "
ENDIF

GRACIAS DE ANTEMANO.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:COMO COMPARAR DOS FECHAS

Publicado por tecniCam (186 intervenciones) el 11/08/2004 00:12:18
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
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:COMO COMPARAR DOS FECHAS

Publicado por johanna (7 intervenciones) el 11/08/2004 16:32:20
imagino que la fecha esta en un datapicker llamado Cdate, tienes que preguntar directamente por el asi, if Cdate>date then y si es contra otro datapicker datapicker1>datapicker2 no intentes lo que estas haciendo porque no te funcionara
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar