how to implementing sql function like datediff in cake php

2012-09-06 Thread Vaibhav.Pathak
Hi
 Please anybody tell me how can i user  SQL function in cakephp query. 

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: how to implementing sql function like datediff in cake php

2012-09-06 Thread Yasir Arafat Hasib
Hello,

I think the following url will help you.
http://arafats.info/cakephp-date-comparison-or-cakephp-date-bewteen-on-database-data/

Thanks
Arafat


On Thu, Sep 6, 2012 at 5:18 PM, Vaibhav.Pathak join2vaib...@gmail.comwrote:

 Hi
  Please anybody tell me how can i user  SQL function in cakephp query.

  --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






-- 
*Thanks  Regards.
-
Yasir Arafat (Hasib)*
*Deputy Project Manager, *Software Solutions
Grameen Solutions
Contact Information:
**
**
Cell : +8801816 536 901, +880197 *333* 2 888
Web: http://arafats.info
http://arafats.info

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: how to implementing sql function like datediff in cake php

2012-09-06 Thread Marcus James
Hi,

Try this example :-

$data =
$this-User-find('first',array('conditions'=array('User.id'=1),'fields'=array('DATEDIFF(now(),User.modified)
as diff','User.*')));




Enjoy,

Marcus

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.