date as a parameter in a query string to mysql
Posted: Wed 17 Nov 2004 15:19
The date format in mysql is yyyy/MM/dd HH:mm:ss
I am using a parameter to select a set of data in a mysql table.
I formatted the parameter as above.
In VB the string passed to the mysqlcommand could be as follow:
MyComm. "SELECT * FROM MyTable WHERE MyDate > " & Chr(39) & strDate & Chr(39)
where strDate could be "2004/11/17 15:00:00". Then I use this mysqlcommand to fill a mysqldatareader.
But doesn't work: no exception occurs but I got no date in the datareader.
What am I supposed to do to retrive all the rows in MyTable where MyDate is greater then "2004/11/17 15:00:00"?
I am using a parameter to select a set of data in a mysql table.
I formatted the parameter as above.
In VB the string passed to the mysqlcommand could be as follow:
MyComm. "SELECT * FROM MyTable WHERE MyDate > " & Chr(39) & strDate & Chr(39)
where strDate could be "2004/11/17 15:00:00". Then I use this mysqlcommand to fill a mysqldatareader.
But doesn't work: no exception occurs but I got no date in the datareader.
What am I supposed to do to retrive all the rows in MyTable where MyDate is greater then "2004/11/17 15:00:00"?