vb.net date format from textbox > MS SQL query
- by Jonesy
Hi folks,
I have a date column in a DB tabel that I want to query using a date taken from textbox.text. the user selects a date from the calendar in the format dd/MM/yyyy. I want to use that date to put into a query. How do i format the date to be able to query the database?
Dim datefrom As String =txtDateFrom.Text
Dim dateto As String =txtDateTo.Text
The query will look like this:
WHERE (tblClient.ClientID = " & ClientID & ") AND (tblBackupArchive.BackupDate BETWEEN '" + datefrom + "' AND '" + dateto + "')"
I'm using MS SQL Server btw. Any help most appreciated.
Jonesy