I have a field in MySQL as varchar and need to do a select with a range. The date is in the following format "%m/%d/%Y" (Ej. 10/14/2010).
-
Why dont you use cast or convert varchar to date format and compare?Sachin Shanbhag– Sachin Shanbhag2010-10-14 16:58:10 +00:00Commented Oct 14, 2010 at 16:58
-
Why are you storing a date as a varchar? If it was stored as a proper date field you could use a normal 'BETWEEN' or equality testing.Marc B– Marc B2010-10-14 16:58:13 +00:00Commented Oct 14, 2010 at 16:58
-
Change this field type to DATE (and data itself accordingly). That's the only proper solutionYour Common Sense– Your Common Sense2010-10-14 16:59:43 +00:00Commented Oct 14, 2010 at 16:59
Add a comment
|