how to count datewise data in sqlserver

Answer Posted / ambi

select BillDate, count(*) [Total] from
AdminSalesDetailsItems group
by convert(varchar(50),BillDate,101)

select BillDate, count(*) [Total] from
AdminSalesDetailsItems group
by convert(varcharBillDate,101)

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the dmvs?

575


What are the different ways you can create databases in sql server?

574


How to grant a permission in ms sql server using "grant execute" statements?

569


How to change the data type of an existing column with "alter table" statements in ms sql server?

534


What is the use of @@spid?

576






How to modify an existing stored procedure in ms sql server?

541


When do you think a developer should use sql server-based cursors?

524


After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas

576


What are the new features in sql server 2016?

550


What is the cartesian product of table?

551


What will be the value of @@fetch_status if a row that was a part of the cursor resultset has been deleted from the database after the time the stored procedure that opened the cursor was executed?

654


What is the impact on other user sessions when creating indexes?

545


How do you start single user mode in clustered installations?

527


What are the difficulties faced in cube development? : sql server analysis services, ssas

612


How are the exceptions handled in sql server programming?

611