Yii Framework Forum: Query Builder:: Between - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Query Builder:: Between Find record between 2 date Rate Topic: -----

#1 User is offline   jowen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 191
  • Joined: 13-July 11
  • Location:Malaysia

Posted 12 October 2011 - 09:05 PM

Hi guys,

how to write the sql statement in query builder::between??
SELECT * FROM sale WHERE DATE(local_created)BETWEEN '2011-10-01' AND '2011-10-07'

$sql=Yii::app()->db->createCommand()
->select ('*')
->from sale
->where(array("date(local_created) between", array('2011-10-01', '2011-10-07'))

0

#2 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 17 October 2011 - 11:27 AM

I think there is not a simple way to do it
for example you can see how hard it is to increment counter via query builder
http://www.yiiframew...-questions/#hh8

so here you also have the same issue... if it is not built in - use DAO

but maybe I wrong...
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users