i been trying to do this with no success:
[tt]
SELECT title, id, date_posted, MONTH(date_posted) AS month_posted, YEAR(date_posted) AS year_posted
FROM blog_posts
WHERE month_posted = 8
[/tt]
it seems to be choking on the "WHERE month_posted" part... which i actually want to use with a variable but im trying to get it going in the simplest possible form. tried it with single quotes around the 8 also.
is it really the case that you can't use an alias created using SELECT AS in your where clause? or am i just missing something?
[tt]
SELECT title, id, date_posted, MONTH(date_posted) AS month_posted, YEAR(date_posted) AS year_posted
FROM blog_posts
WHERE month_posted = 8
[/tt]
it seems to be choking on the "WHERE month_posted" part... which i actually want to use with a variable but im trying to get it going in the simplest possible form. tried it with single quotes around the 8 also.
is it really the case that you can't use an alias created using SELECT AS in your where clause? or am i just missing something?