Aide pour un module sous access 2000

cs_conis Messages postés 1 Date d'inscription lundi 14 avril 2003 Statut Membre Dernière intervention 14 avril 2003 - 14 avril 2003 à 10:43
stevebelgium Messages postés 180 Date d'inscription lundi 17 mars 2003 Statut Membre Dernière intervention 7 juin 2003 - 14 avril 2003 à 14:41
j'ai fait un lien entre le fichier.log d'un site et access 2000 ou j'ai créer une bdd mais je voudrais changer le format de la date qui me revient dans ma table sous ce format [24/may/2002:13:15:36 en format 24/05/2002
on ma di de faire un module en vba mai je ni arrive pa
please help me

1 réponse

stevebelgium Messages postés 180 Date d'inscription lundi 17 mars 2003 Statut Membre Dernière intervention 7 juin 2003 1
14 avril 2003 à 14:41
Option Explicit
Private Sub Command1_Click()

Dim the_date As String
Dim the_day As String
Dim the_year As String
Dim the_month As String
Dim date_complete1 As String
Dim date_complete2 As String

the_date = "24/may/2002:13:15:36"

the_day = Left(the_date, 2)
the_year = Mid(the_date, 8, 4)

Select Case LCase(Mid(the_date, 4, 3))
Case "jan"
the_month = "1"
Case "feb"
the_month = "2"
Case "mar"
the_month = "3"
Case "apr"
the_month = "4"
Case "may"
the_month = "5"
Case "jun"
the_month = "6"
Case "jul"
the_month = "7"
Case "aug"
the_month = "8"
Case "sep"
the_month = "9"
Case "oct"
the_month = "10"
Case "nov"
the_month = "11"
Case "dec"
the_month = "12"
End Select


date_complete1 = Format(the_day, "00") & "/" & Format(the_month, "00") & "/" & the_year

date_complete2 = the_day & "/" & the_month & "/" & the_year

MsgBox date_complete1 & " " & date_complete2
End Sub
0
Rejoignez-nous