With SQL Server 2008 and above, this is simple done executing the query below:
SELECT cast(getDate() AS Date)
For previous versions, the proper way to do it is:
SELECT dateAdd(dd, dateDiff(dd,0, getDate()), 0)
SELECT cast(getDate() AS Date)
SELECT dateAdd(dd, dateDiff(dd,0, getDate()), 0)
SELECT UNIX_TIMESTAMP('2014-01-01') AS start, UNIX_TIMESTAMP('2014-12-31') AS end;
UPDATE video SET
published = (RAND() * (1419980400 - 1388530800) + 1388530800)
WHERE published = 0;
class Articles_model extends Base_module_model {
public $filters = array('content', 'author_name');
public $foreign_keys = array('author_id' => 'authors_model');
function _common_query(){
$this->db->join('authors', 'authors.id = articles.author_id', 'left');
$this->db->select('articles.*', FALSE);
parent::_common_query();
}
}
fuel_model('articles', array('find' => 'all', 'where' => array('author_name' => 'Shakespeare')));