I am using a DateTimePicker to allow the user to select dates between which, info from a database is selected and displayed in a DataGridView.
This works fine exept that the dates selected by the DateTimePicker seem to bring back results in US date format!
If I do a debug.print (DateTime1.text), the date is in UK format i.e 11/05/2009 but when these variables are used in a Select statement, the dates returned seem to be in US format e.g. selecting dates between 01/04/2009 and 7/05/2009 selects dates between 04/01/2009 and 05/07/2009 when the results are displayed in the DataGridView!
Getting DateTime variables:
Code:SDate = sDateTime.Text FDate = fDateTime.Text
Select Statement:
Does anyone know why this is happening?Code:Dim da As New OleDb.OleDbDataAdapter("Select * From Sanctions Where [Group] Like '%EN%' AND [Date] BETWEEN #" & SDate & "# AND #" & FDate & "# AND [Description] <> 'Merits' ", cnDept)
Thanks![]()




Reply With Quote