Saturday 28 May 2016

sql query to get daily count

Introduction:

Here I will explain how to create SQL query to get daily count like daily Users, daily visitors, daily order or get count per day than use to SQL query. if you want to create a query to get count like daily order, daily visitors or get count per day something that time use following SQL query to get data as per your requirement.

So, Now I explaining how to create SQL query to get daily count like daily Users, daily visitors, daily order SQL server

Description: 

In previously post I explained to  
Three tier architecture in asp.net
Remove .aspx from url in asp.net
Temp table in sql
Change the column name or datatype or size in sql server
Stored procedure with paging sql server
Calling web service without adding web reference 





SQL query to get daily countSQL query for daily countsSQL query to get daily data
Calculate Number of Orders per Day
Calculate Number of visitors per Day
How to count number of records per day
Get daily sales order counts
SQL query get count per day
SQL query to get how many user register daily on my website
SQL query to get how many order daily on my website
SQL query to get how many user visit my website daily

Example: 

Below SQL query will get result to how many user register daily on my website


SELECT CONVERT(DATE, CreatedDate) as AllDates, Count(*) as DailyUserRegisterd
FROM tblUser
GROUP BY CONVERT(DATE, CreatedDate)
ORDER BY AllDates DESC




Below SQL query will get result to how many order daily on my website


SELECT CONVERT(DATE, CreatedDate) as AllDates, Count(*) as DailyOrder
FROM tblOrder
GROUP BY CONVERT(DATE, CreatedDate)
ORDER BY AllDates DESC



Below SQL query will get result to how many user visit my website daily


SELECT CONVERT(DATE, CreatedDate) as AllDates, Count(*) as DailyVisitors
FROM tblVisitor
GROUP BY CONVERT(DATE, CreatedDate)
ORDER BY AllDates DESC





(In above SQL query change table name and field name as per your table name)

 

No comments:

Post a Comment



Asp.net tutorials