When I looked at the database record, the datetime saves like this: 4/6/2012 04:42:28 PM
because I've save it using dbtype.string
Now, I'm getting the date only, not including time, this is my code:
Private Sub getpapererror(ByVal ddate As String)
Dim sqlstr As String = "select * from perror where date(ddate) = $xddate"
Dim sqlcmd As New SQLiteCommand(sqlstr, mycon)
sqlcmd.Parameters.Add("$xddate", DbType.String).Value = ddate
...
End Sub
Dim xdt As DateTime = DateTime.Now
getpapererror("#" & xdt.Month.ToString & "/" & xdt.Day.ToString & "/" & xdt.Year.ToString & "#")
I want to get only the date
string.Formatif you really want to use strings). Why aren't you just using a date/time type anyway?