Barry, I think you've got too many quotes in your SQL - the db is
trying to find the year from the string 'date paid'.  You want to use
it as a column name, so drop the quotes:

Select * from Capclave2005reg
Where Year(Date Paid) = 2004;

If you've really got a space in your column name, try enclosing it in
backticks instead of quotes - ` instead of ', as in

Select * from Capclave2005reg
Where Year(`Date Paid`) = 2004;

Regards,
Dan

On 7/20/06, Barry Newton <[EMAIL PROTECTED]> wrote:
I've got a table of people who registered for a convention.  Each person
has a registration date, kept in a standard date field.  How do I select
for people who registered in a particular month or year?  The obvious tests
like:

Select * from Capclave2005reg
Where Year('Date Paid') = 2004;

return no rows.  I can extract any piece of that date I want in a SELECT,
but can't seem to use it in a WHERE clause at all.  There has to be
something really obvious that I'm missing?


Barry Newton



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to