am using sql 2005 and vb 2008.i need to compare dates and select matching records betweem a selected date range.say records between 11/13/2010 and 11/20/2010.e.thing is working ok except when it comes to selecting dates between 11/1/2010 and 11/9/2010.this is happening because when am retrieving the dates from database,its being retrieved in the format 11/01/2010 instead of 11/1/2010 and so it reports no records found,and knowing the limits of sql 2005 this is the only way i can retrieve the date.
anyone who knows how to go about this?
below is the code..
myCmd3 = New SqlCommand("Select sequenceID, CONVERT (varchar(10), CallDate, 101) AS CallDate from........
Dim date1 As DateTime = Convert.ToDateTime(TextBoxStartDate.Text)
Dim date2 As DateTime = Convert.ToDateTime(TextBoxEndDate.Text)......
condition += CallDate >= '" + date1 + "' and CallDate <= '" + date2 + "' "........