Re: [PHP-DB] Calculated field in MySQL

2003-08-14 Thread John W. Holmes
Morten Twellmann wrote: Hello, I got the following error message from MySQL: --- Query failed. MySQL said: Unknown column 'AGE' in 'where clause' query = SELECT *, (Year(Now()) - Year(BDAY)) + ((DAYOFYEAR(Now())-DAYOFYEAR(BDAY))/365) as AGE FROM Katalog WHERE AGE >= 31 AND AGE <= 50 AND IS_MEM_

Re: [PHP-DB] Calculated field in MySQL

2003-08-10 Thread jeffrey_n_Dyke
one thinglooks like you need one more outer set of paren's to tie both sets of the equation together. query = SELECT *, ((Year(Now()) - Year(BDAY)) + ((DAYOFYEAR(Now()) -DAYOFYEAR(BDAY))/365)) as AGE FROM Katalog WHERE AGE >= 31 AND AGE <= 50 AND IS_MEM_EXP = 0 AND IS_OPEN = 1 ORDER BY INPUT_