bonjour
Voila peut on modifier lors de l'export le format de la date pour enlever les heures
si j'utilise
c'est bon
Code : Sélectionner tout - Visualiser dans une fenêtre à part choixx = "(month(F_POIN.Date_Saisie) = 7 or month(F_POIN.Date_Saisie) = 8)"
parcontre
ou
Code : Sélectionner tout - Visualiser dans une fenêtre à part choixx = "(month(F_POIN.Date_Saisie) = month(date))"
du au format de date je pense
Code : Sélectionner tout - Visualiser dans une fenêtre à part choixx = "(Format(F_POIN.Date_Saisie,'dd/mm/yyyy')=date())"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 Sub importpointage() MsgBox Month(Date) Application.ScreenUpdating = False Sheets("import").Visible = True Sheets("import").Select Cells.Select selection.Clear choixx = "(month(F_POIN.Date_Saisie) = 7 or month(F_POIN.Date_Saisie) = 8)" 'choixx = "(Format(F_POIN.Date_Saisie,'dd/mm/yyyy')=date())" With ActiveSheet.ListObjects.Add(SourceType:=0, Source:= _ "ODBC;DSN=lofic;UID=Administrateur;Trusted_Connection=Yes;APP=Microsoft Office 2010;WSID=DELL04;DATABASE=LOFIC" _ , Destination:=Range("$A$1")).QueryTable .CommandText = _ "SELECT F_POIN.DO_Piece, F_POIN.RP_Code, F_POIN.AR_ref, F_POIN.Date_Saisie , F_POIN.DL_Qte, F_POIN.Initiales" _ & Chr(13) & "" & Chr(10) & "FROM LOFIC.dbo.F_POINTAGE WHERE year(Date_Saisie)='2017' and Initiales IN ('FC0065','FC0105') and RP_Code IN('0FCTRL','FEMBA') AND " & choixx .RowNumbers = True .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .PreserveColumnInfo = True .Refresh BackgroundQuery:=False .Delete End With Application.ScreenUpdating = True End Sub
Partager