Description:
In this example we explain that how to get download
count Day, Month, Year wise in a single query Using SQL Query. Or how to get
download count reports of Day, Month, Year in a single query using SQL Query.
Suppose you have to display some charts or report of
the website viewer or mobile app download count for Day, Moth, Year wise at
that time below SQL Query is useful to get the data.
Query:
SELECT DATEPART(YEAR, DownloadDate) AS 'Year',
DATEPART(MONTH, DownloadDate) AS 'Month',
DATEPART(DAY, DownloadDate) AS 'Day',
COUNT(*) AS 'Visits',
DownloadDate
FROM AppCounts
GROUP BY
DATEPART(DAY, DownloadDate),
DATEPART(MONTH, DownloadDate),
DATEPART(YEAR, DownloadDate),
DownloadDate
ORDER BY
'Year',
'Month',
'Day'
0 comments:
Post a Comment