Home > MS-Office > X004| ACCESS- NÚMERO DE SEMANA EN ACCESS

X004| ACCESS- NÚMERO DE SEMANA EN ACCESS

a) DateDiff(“ww”, “1/1/” & Year(Now()), Now())
b) NumeroSemanaISO’* Calcula el número de semana de la fecha pasada o por defecto de la actual’* según la ISO 8601 la primera semana del año es la que tiene al menos cuatro’* días del nuevo año’* Argumentos: datFecha => Opcional Fecha de calculo’* uso: NumeroSemanaISO (Date)’* Attributed to Daniel Maher’* ESH 20/04/05 16:05
‘*******************************************************************************
Public Function NumeroSemanaISO(Optional datFecha As Date) As IntegerDim lngFecha As Long
On Error GoTo NumeroSemanaISO_TratamientoErrores
If datFecha = 0 Then
datFecha = DatelngFecha = DateSerial(Year(datFecha – Weekday(datFecha – 1) + 4), 1, 3)
NumeroSemanaISO = Int((datFecha – lngFecha + Weekday(lngFecha) + 5) / 7)NumeroSemanaISO_Salir:
On Error GoTo 0
Exit Function
NumeroSemanaISO_TratamientoErrores:
MsgBox “Error ” & Err.Number & ” en proc.: NumeroSemanaISO de Módulo: Módulo1 (” & Err.Description & “)”
Resume NumeroSemanaISO_Salir
End Function ‘ NumeroSemanaISO

Categories: MS-Office
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.