That is a string comparison, so they will never be equal. You don't
have to put quotes around field names unless you are using reserved
words, which you shouldn't. If you do use "quotes" around field
names, you need to use `backticks`.
On Oct 10, 2007, at 1:15 PM, Martijn Tonies wrote:
> Sorry about double post, I am having problems with my ISP.
>
> I have the following query:
>
> SELECT *
> FROM Sight_Hearing_Help
> WHERE 'type_help' = "Eye Exam & Glasses"
> AND 'board_action_date' BETWEEN "07-01-2007" AND "12-31-2007"
> LIMIT 0 , 60;
>
> Returns empty row every time. The boar
russbucket wrote:
Sorry about double post, I am having problems with my ISP.
I have the following query:
SELECT *
FROM Sight_Hearing_Help
WHERE 'type_help' = "Eye Exam & Glasses"
AND 'board_action_date' BETWEEN "07-01-2007" AND "12-31-2007"
LIMIT 0 , 60;
Returns empty row every time. The boa
Have you tried testing the two parts of your WHERE clause separately?
Regards,
Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
www.the-infoshop.com
www.giiexpress.com
www.etudes-marche.com
> -Original
Oh boy.. having the date stored as a varchar in that particular format will be
profoundly problematic. You might want to store it -MM-DD or the SQL
BETWEEN will mangle the expected return results.
Does it work (return a non-empty result-set) when you omit the LIMIT clause?
Does it work (re
[snip]
SELECT *
FROM Sight_Hearing_Help
WHERE 'type_help' = "Eye Exam & Glasses"
AND 'board_action_date' BETWEEN "07-01-2007" AND "12-31-2007"
LIMIT 0 , 60;
[/snip]
Try WHERE type_help LIKE '%Eye Exam & Glasses%' and look at your dates
in the database themselves even if they are varchars, they ar
russbucket wrote:
> I have the following query:
>
> SELECT *
> FROM Sight_Hearing_Help
> WHERE 'type_help' = "Eye Exam & Glasses"
> AND 'board_action_date' BETWEEN "07-01-2007" AND "12-31-2007"
> LIMIT 0 , 60;
>
> Returns empty row every time. The board_action_date is a varchar field.
> Not a da