catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.84k stars 1.15k forks source link

How to use date_format in select or get ? #415

Closed elbyvilayil closed 5 years ago

elbyvilayil commented 8 years ago

How to convert following query to medoo select ?

select *, date_format(column_name, '%d %b %Y') as column_alias from table_name;

kaiser-tushar commented 5 years ago

We can use like this, table.created[<=] = date('Y-m-d H:i:s', $end_date)

But how can we use this, DATE(table.created)[<=] = date('Y-m-d', $end_date)

I need to run DATE(created) type query. Can we do that?

catfan commented 5 years ago

It's possible to do that using raw object. https://medoo.in/api/raw