The first query is more easy like this:
array('Campaign.start_date BETWEEN ? AND ?' => array($startDate, $endDate)

Try it, will work on cake. and the second is simple array('c.start_date <='
=>  $value, 'c.end_date >=' $value)

Tip: read http://book.cakephp.org/view/1017/Retrieving-Your-Data

On Wed, May 19, 2010 at 4:28 PM, Narendra Padala <[email protected]>wrote:

>
> there i have one doubt in my query
>
>
> I converted this query in to cake like this...its working
>
> ((c.start_date >= '{$this->startDate}' AND c.start_date <=
> '{$this->endDate}')
>
>
>  array('AND'=>array('Campaign.start_date >='=>$strDate),
>                     array('Campaign.start_date =<'=>$endDate))
>
>
> but this query how can i convert into cake php please help me out
>
>   ('2010-05-19' >= c.start_date AND '2010-05-19' <= c.end_date)
>   ('   value'  >= 'filed name'  AND 'value' <='filed name')
>
>  cakephp ?...
>
>
> any one please help me out.
>
>
> On Wed, May 19, 2010 at 6:38 PM, Jeremy Burns <[email protected]> wrote:
>
>> http://book.cakephp.org/view/1030/Complex-Find-Conditions
>>
>> Jeremy Burns
>> [email protected] <[email protected]>
>>
>>
>> On 19 May 2010, at 14:06, Narendra Padala wrote:
>>
>> Hi ...All I am new to cake php, I need to write where conditions like this
>> please any one can help me out
>>
>>
>>                     WHERE
>>                     ((c.start_date >= '2010-05-19' AND c.start_date <=
>> '2010-06-30')
>>                     OR (c.end_date >= '2010-05-19' AND c.end_date <=
>> '2010-06-30')
>>                     OR ('2010-05-19' >= c.start_date AND '2010-05-19' <=
>> c.end_date)
>>                     OR ('2010-06-30' >= c.start_date AND '2010-06-30' <=
>> c.end_date))
>>                     AND `c`.`status` NOT IN ('request', 'cancelled')
>>                     AND `s`.`store_id` = '3'
>>
>> Please any one can convert this query in to cakephp please help me
>> out.......thanks in advance.
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected] For more options, visit this group
>> at http://groups.google.com/group/cake-php?hl=en
>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]<cake-php%[email protected]>For
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Bogdan Iulian Bursuc

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to