paulman888888 Posted June 10, 2009 Share Posted June 10, 2009 hi; I inserted my date into a normal text in the format of DD-MM-YY and i want to use the where in mysql. Example; SELECT * from table WHERE thedate > todays date What i am trying to ask for is a different way of finding days that are before today in mysql. Thankyou Paul Link to comment https://forums.phpfreaks.com/topic/161667-help-with-curdate-not-working/ Share on other sites More sharing options...
Dathremar Posted June 10, 2009 Share Posted June 10, 2009 SELECT * from table WHERE thedate > todays date will give You the dates that are larger then today's date. Do you have that kind of record? Maybe try: SELECT * from table WHERE thedate >= todays date; And try printing out "thedate" to see if the format matches Link to comment https://forums.phpfreaks.com/topic/161667-help-with-curdate-not-working/#findComment-853054 Share on other sites More sharing options...
Maq Posted June 10, 2009 Share Posted June 10, 2009 Why not store it as the 'date' type so you can perform logical operations like this? P.S. - thedate > today's date makes no sense. If you want the dates that come before today's date, then it would be thedate Link to comment https://forums.phpfreaks.com/topic/161667-help-with-curdate-not-working/#findComment-853055 Share on other sites More sharing options...
paulman888888 Posted June 10, 2009 Author Share Posted June 10, 2009 Why not store it as the 'date' type so you can perform logical operations like this? P.S. - thedate > today's date makes no sense. If you want the dates that come before today's date, then it would be thedate < today's day. Is there a way to convert data already in the table to this format? Dathremar; It doesn't work but thankyou all the same. Thankyou all Paul Link to comment https://forums.phpfreaks.com/topic/161667-help-with-curdate-not-working/#findComment-853105 Share on other sites More sharing options...
Maq Posted June 10, 2009 Share Posted June 10, 2009 Is there a way to convert data already in the table to this format? Read this thread - convert string to date. Link to comment https://forums.phpfreaks.com/topic/161667-help-with-curdate-not-working/#findComment-853110 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.