Bonjour,

Je n'arrive pas à faire ma requête qui sélectionne toutes les opérations réalisées entre deux dates.

J'ai pourtant tout essayé :

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
 
 
S1 = S1 & " and Maintenance!Datem between " & CStr(Me.Cmb_date1.Value) - 1 & " and " & CStr(Me.Cmb_date2.Value) - 1
 
           S1 = S1 & " and Datem between " & Format(Me.Cmb_date1.Value, "dd/MM/yyyy") & " and " & Format(Me.Cmb_date2.Value, "dd/MM/yyyy")
 
            S1 = S1 & " and Datem='" & Format(Me.Cmb_date1.Value, "dd/MM/yyyy") & "'"
 
            S1 = S1 & " and Datem between '" & Me.Cmb_date1.Value & "' and '" & Me.Cmb_date2.Value & "'"
 
            S1 = S1 & " and Datem between '" & CStr(Me.Cmb_date1.Value) & "' and '" & CStr(Me.Cmb_date2.Value) & "'"
 
            S1 = S1 & " and Datem between '" & Format(Me.Cmb_date1.Value, "dd/MM/yyyy") & "' and '" & Format(Me.Cmb_date2.Value, "dd/MM/yyyy") & "'"
 
            S1 = S1 & " AND Datem>=#" & Format(Me.Cmb_date1.Value, "dd/MM/yyyy") & "# AND Datem<=#" & Format(Me.Cmb_date2.Value, "dd/MM/yyyy") & "#"
 
            S1 = S1 & " and Datem between " & Format(Me.Cmb_date1.Value, "mm/dd/yyyy") & " and " & Format(Me.Cmb_date2.Value, "mm/dd/yyyy")
 
            S1 = S1 & " and Datem between " & Format(Me.Cmb_date1.Value, "yyyy-mm-dd") & " and " & Format(Me.Cmb_date2.Value, "yyyy-mm-dd")
 
            S1 = S1 & " and Datem between " & Me.Cmb_date1.Value & " and " & Me.Cmb_date2.Value
 
            S1 = S1 & " and Datem between " & Me.Cmb_date1.Value & " and " & Me.Cmb_date2.Value
 
            S1 = S1 & " and Maintenance!Datem between " & CLng(Me.cmbdate1) & " and " & CLng(Me.cmbdate2)
Avec une date ca fonctionne ... mais deux ca bug!