I want to select some rows from a SQL server database using vb.NET. The selection is based on a datetime field in Vb.NET (the datetime should be between two values which are colums in my sql table). I can't seem to find the correct format.
The statement should be something like
Select * from Table Where dotNetDate Between DateColumn1 and DateColumn2
If tried this in vb.net but it returns nothing...
sqlCmd = New SqlCommand("SELECT * FROM Table WHERE '" + pdatDate.ToString("d/MM/yyyy hh:mm:ss") + "' between FromDateTime and ToDateTime", objSQLConn)
Tnx for the help.