Ver Mensaje Individual
  #5 (permalink)  
Antiguo 03/10/2005, 04:20
algicor
 
Fecha de Ingreso: abril-2003
Mensajes: 260
Antigüedad: 22 años
Puntos: 0
He encontrado una posible solucion,
Por el momento me funciona, pero aun no se si ira bien para todos los posibles casos...
Aki pongo la funcion, si a alguien le interesa....

function ValidaFechaNoticia(DateNoticia,IdFichaNoticia)

fechaHoy=Date()
FechaDD = Mid(fechaHoy,1,2)
FechaMM = Mid(fechaHoy,4,2)
FechaAAAA = Mid(fechaHoy,7,4)
tmp_fechaHoy=FechaAAAA & FechaMM & FechaDD
tmp_fechaHoy= CLng(tmp_fechaHoy)


tmp_DateNoticia=ConvertFechaEsp(DateNoticia)
DateNoticiaDD = Mid(DateNoticia,1,2)


if (DateNoticiaDD > 20) AND (DateNoticiaDD < 32 )then
DateNoticiaDD = DateNoticiaDD - 20
if (DateNoticiaDD > -1) AND (DateNoticiaDD < 10) then
DateNoticiaDD = 0 & DateNoticiaDD
End if
DateNoticiaMM = Mid(DateNoticia,4,2) + 1
DateNoticiaaAAAA = Mid(DateNoticia,7,4)
tmp_DateNoticia=DateNoticiaaAAAA & DateNoticiaMM & DateNoticiaDD
tmp_DateNoticia= CLng(tmp_DateNoticia)

else
tmp_DateNoticia= CLng(tmp_DateNoticia) + 10
End if

if (tmp_DateNoticia < tmp_fechaHoy ) then
SqlBaja = " UPDATE FichaNoticia Set Baja= 1,FechaBaja="&fechaHoy&" WHERE IdFichaNoticia = " & IdFichaNoticia & ""
Set bd = bdconn.Execute(SqlBaja)

End if
__________________
Salut i Força al Canut

Última edición por algicor; 03/10/2005 a las 04:26