4

I need to group by only date without time from datetime field in table.What can i do friends?

Here My Table field is,

enter image description here

My Mysql query is,

select *,count(ord_number) as ord from tbl_order_details inner join tbl_users on tbl_users.user_id=tbl_order_details.user_id  where 1=1 group by ord_date order by ord asc

2 Answers 2

3

You can do it by DATE()

Example -

group by DATE(ord_date)

Try this

select *,count(ord_number) as ord from tbl_order_details inner join tbl_users on tbl_users.user_id=tbl_order_details.user_id  where 1=1 group by DATE(ord_date) order by ord asc
Sign up to request clarification or add additional context in comments.

Comments

1

use DATE() function

select *,count(ord_number) as ord from tbl_order_details inner join 
tbl_users on tbl_users.user_id=tbl_order_details.user_id  where 1=1 
group by DATE(ord_date) order by ord asc

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.