| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Member | Date Query Problem I have got date stored in MySQL in this format "Sat, 22 Oct 2005 - 19:30:00" and I want to write a query to select ALL records with DATE coming AFTER the CURRENT DATE or TODAY. In other words I want to select all future dates only. Can anyone help ? http://www.binarytrends.com |
| |
| | #3 (permalink) |
| NamePros Member | Would this work? Code: SELECT * from your_table WHERE date_field > date('D, j M Y - h:i:s')
__________________ Girl Arcades.com - Girl Themed Topsite JOIN NOW TalkChevelles.com for sale. FlameGames.com - Online Arcade |
| |
| | #6 (permalink) |
| NamePros Member | I made a mistake long ago by making this field a varchar and storing the date and time in a english style date and now I got in trouble. But I have finally got round it ![]() Thanks everyone. I finally got round it by using this : DATEDIFF(str_to_date(right(myDateField, 22),'%d %b %Y'),CURDATE())>0 So if anyone ever makes a mistakes by making a date field VARCHAR, this is the solution to compare it with current date ![]() Thanks http://www.binarytrends.com |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| soooo many yahoo's | redhippo | Domain Name Discussion | 5 | 07-12-2005 11:26 PM |
| ReleaseDates.com | jumpbug | Domain Appraisals | 11 | 06-30-2005 09:37 AM |