Reputation: 71
i have stored date in string format in the MySQL database . i have to generate monthly(0-31) report of data but query gives wrong results because date is store in string format.... any one can tell me how to solve this problem and what will be the query.
Upvotes: 0
Views: 54
Reputation:
Sql command for convert this:
SELECT convert(datetime, 'date here').
Upvotes: 1
Reputation: 1508
then convert it to a date type and not a string type. or else parse it into an date.
First hit on google: sql string in date: http://www.sqlusa.com/bestpractices/datetimeconversion/
Upvotes: 0