Hello Dears
I Have multiple table with an colum, createddate with date datatype
i want to count data from table year wise
as
2017 2018 2019
400 50 500
Hi ps222,
Refer below sample query to get Count Yearwise.
SELECT DATEPART(YEAR,OrderDate) [Year],COUNT(OrderDate) [Count] FROM Orders GROUP BY DATEPART(YEAR,OrderDate)
Then display record as per your output use pivot query.
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.