Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SABER CUANTOS DOMINGOS HAY

0 views
Skip to first unread message

noticias

unread,
Feb 2, 2001, 11:21:52 AM2/2/01
to
Tienes que crearte la funcion ya que no hay nada que te cuente los domingos,
pero si puedes calcular el numero de dias dividirlos entre 7 (dias de la
semana) y asi mas o menos podras calcularlo
"Carlos Sifontes" <CSIF...@CANTV.NET> escribió en el mensaje
news:#67ToMTjAHA.2092@tkmsftngp04...
> ESTOY REALIZANDO UN SISTEMA QUE ASIGNA UNA FECHA DE ENTREGA DE UN
ARTICULO,
> A LA HORA DE CALCULAR LA FECHA DE ENTREGA NECESITO SABER SI ESTA ES UN DIA
> DOMINGO PARA ASIGNARLE UN DIA MAS, EXISTE ALGUNA FUNCION QUE VERIFIQUE
> CUANTOS DOMINGOS HAY ENTRE DOS FECHAS . CARLOS
>
>


Jhonny Vargas P.

unread,
Feb 2, 2001, 1:47:56 PM2/2/01
to
Hola Carlos,

Deberás crear tu propia función para saber cuantos domingos existen entre un
rango de fechas, para ello puedes utilizar lo siguiente:

Funcion ContarDomingos (FechaInicio As Date, FechaTermino As Date)
sDomingos = 0
While FechaInicio <= FechaTermino
If Weekday(FechaInicio) = vbSunday Then
sDomingos = sDomingos + 1
End If
FechaInicio = FechaInicio + 1
Wend

ContarDomingos = sDomingos
End Function


Espero que te sirva...
Saludos,
Jhonny Vargas P.

Francisco Ruiz

unread,
Feb 2, 2001, 6:51:21 PM2/2/01
to
seguro pero poco eficiente

esta si es eficiente:

domingos = DateDiff("ww", FechaInicial, FechaFinal, vbSunday)
If Weekday(FechaInicial) = vbSunday Then domingos = domingos + 1

FRV

Jhonny Vargas P. <jhonny...@indexa.cl> escribió en el mensaje de
noticias OwWctiUjAHA.1224@tkmsftngp05...

0 new messages