Table profile
ID Name curdate
1 John 2014-10-08
2 Steve 2014-09-06
3 Mark 2014-06-07
----------------------------
My Query
SELECT rs.*
FROM (SELECT p.*, SUBSTR(p.`curdate`,1,4) AS d_year, SUBSTR(p.`curdate`,6,2) AS d_month, SUBSTR(p.`curdate`,9,2) AS d_day FROM profile AS p) AS rs WHERE rs.d_month IN ('10','06');
Anyone knows how to implement this query in activerecords?.
The reason why i want this query, Its because i want a custom search of curdate by year, month, day. I don’t know how to execute this.
pls help. thank you.