My design have two textbox and a calendar. I want to write a query to select a date range for example from 19/03/2014 to 03/05/2014. My date is select from the calendar and it will fill in both txtsearch.Text and txtsearch2.Text.
I know the query to get the date between two dates, but how can I proceed my query to get the data range between different dates, months and also years too?
Here is my query to get date between two dates:
SELECT * FROM mytable
WHERE CONVERT(VARCHAR(10),enq_date_time,103) BETWEEN
CONVERT(VARCHAR(10),'" & txtsearch.Text.Trim & "',103)
AND CONVERT(VARCHAR(10),'" & txtsearch2.Text.Trim & "',103)