Please show me what is the correct code to compare the DateAdded (2012-12-26 00:00:00 - its format inside MySQL) and DTPicker (01-01-2000 default format from user input)
Sub FilteredQuery()
cnDDR.Open "Driver={Mysql ODBC 3.51 Driver}; server=x; port=3307; database=x; user=x; password=x; OPTION= 1 + 2 + 8 + 32 + 2048 + 16384"
With cmd
.ActiveConnection = cnDDR
.CommandType = adCmdText
.CommandText = "SELECT ItemCode, ItemName, Category, Description, Supplier, ItemPrice, InStock, OnOrder, DateAdded FROM comparts WHERE Category = '" + CategorySorter.Text + "' AND AND DateAdded >= #" & Format(DTPicker1.Value, "YYYY/MM/DD") & "# AND DateAdded <= #" & Format(DTPicker2.Value, "YYYY/MM/DD") & "#"
.Execute
End With
With rsDDR
.ActiveConnection = cnDDR
.CursorLocation = adUseClient
.Open cmd
End With
End Sub