Jump to content

[Cakephp] Between Date condition?


alvin567

Recommended Posts

Great!!

 

    $conditions = array(

                        'Renewal.year' => $renewal_period,

                        'Renewal.void' => 0,

                        'Renewal.approved' => 3,

                        'Claim.void' => 0,

                        'Claim.draft' => 0

                        );

 

Can I do this?

 

  array_push($conditions, array('Claim.created BETWEEN ? and ?' => array(strtotime($start), strtotime($end))));

 

 

Link to comment
Share on other sites

On top of that I have this error?

Warning (2): mssql_query() [function.mssql-query]: message: Conversion failed when converting date and/or time from character string. (severity 16) [CORE/cake-1.2.6/libs/model/datasources/dbo/dbo_mssql.php, line 181]

Warning (2): mssql_query() [function.mssql-query]: General SQL Server error: Check messages from the SQL Server. (severity 5) [CORE/cake-1.2.6/libs/model/datasources/dbo/dbo_mssql.php, line 181]

Warning (512): SQL Error: Conversion failed when converting date and/or time from character string. [CORE/cake-1.2.6/libs/model/datasources/dbo_source.php, lin

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.