> I'm trying to figure out a query that will tell me the total number of
> people in our house email file that physically opted out in the last
> week.  I'm a bit of a mysql newbie as you can tell...
> 
> This is the general concept, though it doesn't seem to work:
> 
> select count(id) from contact       # my data table 
> where optin='no'      # shows they are an opt-out
> AND bad_email IS NULL # is ticked if it was a bounceback opt-out
> AND email IS NOT NULL         # show only for records that have emails
> AND date >= 2002-03-17;       # show data only since last sunday
> 
> I appear to be getting hung up on the date part.  I'm not sure if I can
> use that kind of operator on a date with that format.  Any help is
> appreciated!

You need to put the date constant in quotes:

 ... AND date >= '2002-03-17';

-- 
Roger

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to