Thanks for everyone's help, but I'm still having issues with the
substring

I have debugging turned on and it does not like the parentheses '()'
Below is the actual mysql error:

SQL Error: 1064: You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near ')  =  '2008-02-04'' at line 1 [CORE/cake/libs/
model/datasources/dbo_source.php, line 440]

grigri: what does the '-!' do in your example below?

Thanks

On Feb 1, 4:25 am, grigri <[EMAIL PROTECTED]> wrote:
> Try this:
>
> $data = $this->find(array('campaign_id as id'=>
> $id,'-!substring(upload_date,1, 10) = \'2008-01-31\''),
> array('imp','clicks','ctr','cpc','cost','pos','conv','conv_rate','cost_per_conv'))
>
> On Feb 1, 3:56 am, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
>
> > You should turn on debugging to see the actual SQL that is being
> > executed, and then try running it in Mysql.
>
> > Wayne
>
> > On 1/31/08, roliver <[EMAIL PROTECTED]> wrote:
>
> > > Can anyone tell me if it is possible to use the 'substring' keyword in
> > > Model->findAll()   I'm trying to do this but I keep getting the mysql
> > > error "you have an error in yoru sql near...blah..blah) The query I'm
> > > using is below.
>
> > > $data = $this->find(array('campaign_id as id'=>
> > > $id,'substring(upload_date,1, 10)'=>'2008-01-31'),
> > > array('imp','clicks','ctr','cpc','cost','pos','conv','conv_rate','cost_per_conv'))
>
> > > If can't then what should I use Model->query() ?
>
> > > thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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