Problème de date avec vb et access - VB/VBA/VBS - Programmation
Marsh Posté le 26-08-2005 à 11:25:13
une petite recherche dans google et voila : 
http://www.cpearson.com/excel/DateTimeVBA.htm 
 
Monday Of A Given Week Number (WeekStart) 
 
This function returns the date of the Monday in a given week number, e.g., the Monday of the 15th week of 1998.  It requires the YearStart function, given above. 
 
Public Function WeekStart(WhichWeek As Integer, WhichYear As _ 
                    Integer) As Date 
 
WeekStart = YearStart(WhichYear) + ((WhichWeek - 1) * 7) 
 
End Function 
 
   
 
First Monday Of The Year (YearStart) 
 
The following function was provided by John Green, an Excel MVP from Australia.   It returns the first Monday of the specified year.  This function is used by other functions on this page. 
 
Public Function YearStart(WhichYear As Integer) As Date 
 
Dim WeekDay As Integer 
Dim NewYear As Date 
 
NewYear = DateSerial(WhichYear, 1, 1) 
WeekDay = (NewYear - 2) Mod 7 'Generate weekday index where Monday = 0 
 
If WeekDay < 4 Then 
    YearStart = NewYear - WeekDay 
Else 
    YearStart = NewYear - WeekDay + 7 
End If 
 
End Function
Marsh Posté le 26-08-2005 à 11:15:51
Bonjour à tous,
Pour une gestion de personnel en entreprise sur access, je cherche à récupérer à partir d'un numéro de semaine du calendrier, la date correspondant au lundi de cette semaine.
Comment puis-je procéder ? je me creuse la tête mais là je ne vois vraiment pas.
Pouvez-vous m'aider ?
Exemple : je donne le numéro 34 (celui de cette semaine) et il me renvoie la date du lundi 22/08/2005.
Merci infiniment.
Seb.