I am writing Twitter data for a project that I am working on date information is saved as Thu, 14 Jul 2011 06:21:48 +0000 in the line field.
How to select data between two dated using mySQL? I can get data greater than a value or less than a value, but not between the values.
Data, for example:
Thu, 14 Jul 2011 06:21:48 +0000 Thu, 14 Jul 2011 12:18:21 +0000 Thu, 14 Jul 2011 18:48:00 +0000 Thu, 14 Jul 2011 23:48:02 +0000 Fri, 15 Jul 2011 06:48:10 +0000 Fri, 15 Jul 2011 12:48:00 +0000 Fri, 15 Jul 2011 18:43:32 +0000 Fri, 15 Jul 2011 23:44:08 +0000 Sat, 16 Jul 2011 06:47:08 +0000 Sat, 16 Jul 2011 12:46:49 +0000 Sat, 16 Jul 2011 18:45:41 +0000 Sat, 16 Jul 2011 23:41:27 +0000
My SQL string:
SELECT * FROM twitter WHERE SUBSTR(twitter_date, 6, 11) >= '2011-06-15' AND SUBSTR(twitter_date, 6, 11) <= '2011-06-21'
I also tried the BETWEEN instructions, but no luck.
Any help would be appreciated!
source share