Re: Using MySQL's DAYNAME in find

2009-06-03 Thread toby1kenobi
Thanks for the replies, and apologies for not responding sooner - busy! I'm going to try your suggestions out later today though, I'll report back here. theChrisWalker wrote: > If you add an alias to the field list you can do this (I think, again > not tested...) > > $this->paginate['fields'] = a

Re: Using MySQL's DAYNAME in find

2009-06-03 Thread theChrisWalker
If you add an alias to the field list you can do this (I think, again not tested...) $this->paginate['fields'] = am( $this->paginate['fields'], array ( 'DAYNAME(Model.field) as `day`' ) ); $this->paginate['conditions'] = am( $this->paginate['conditions'], array('`day`'=>'Monday' ) ); but as Mart

Re: Using MySQL's DAYNAME in find

2009-06-02 Thread Martin Westin
You don't post any mysql error or what the query looked like (it usually tells you what is wrong). A shot in the dark but it could be this simple: array('((DAYNAME (Model.field)))' => 'Monday'); On Jun 2, 12:46 pm, toby1kenobi wrote: > Hi there, > >   Is it possible to use MySQL's DAYNAME func

Using MySQL's DAYNAME in find

2009-06-02 Thread toby1kenobi
Hi there, Is it possible to use MySQL's DAYNAME function in the where clause of a call to 'find'? i.e. something a bit like: $this->paginate['conditions'] = array('DAYNAME(Model.field)' => 'Monday'); The above doesn't work (which is what I was expecting) but I haven't managed to find an equ