I need help in writing the following raw MYSQL query in Propel ORM in "symfony 1.1.9" framework which contains MySQL functions in SELECT and WHERE.
SELECT DATE( u.date ) date, TIME( u.date ) time, u.id account_id, u.user_name ,
IF( ( SELECT COUNT( id )
FROM bank
WHERE user_id = u.id
AND DATE( creation_date ) > DATE_ADD( CURDATE( ) , INTERVAL -30
DAY )
GROUP BY user_id ) , 'Y', 'N'
) AS deposited
FROM user u
WHERE DATE( u.dat ) > DATE_ADD( CURDATE( ) , INTERVAL -30
DAY )
I searched a lot for this. but could't get any relevant solution. I tried this with many possible solution. But nothing works. Note that i'm not prefer to use raw query . Please help. Any help would be greatly appreciated. Thanks in advance.