Ian ORourke said:
> Is it possible to have a 'worked out value' in the WHERE clause. The
> problem I have is what I need to check for in the WHERE Clause is
> not a column:
>
> SELECT
> CONCAT_WS("-",DATE_FORMAT(EntryDate,'%c'),DATE_FORMAT(EntryDate,'%Y'))
> As mthyr
> From Blogs
> WHERE mthyr=1-2003
>
> This does not work as it seems to want a valid column in the WHERE
> clause. Anyway around it?


SELECT CONCAT_WS("-",Month(EntryDate),Year(EntryDate)) As mthyr
FROM   Blogs
WHERE  Year(EntryDate) = 2003
       AND
       Month(EntryDate) = 1

Jochem





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

Reply via email to