Hello all,
I am in the process of migrating an Access database to a SQL Server backend. I'm pretty new to SQL Server so I'm learning along the way.
I need to populate a dashboard with multiple recordcounts from the same table, so I'm looking for an efficient way of doing this.
Let's say I have a table in my SQL Server backend called tblOrders.
Relevant columns are OrderID (PK), OrderDate and OrderStatus.
On my dashboard I want to display the number of orders this year, last year, two years ago. Number of orders this year with Status Completed, status pending, status on hold, etc.
In total around 20 recordcounts based on different criteria.
What is the best way to get these numbers?
I can use 20 Dcounts on my linked table, but this puts the workload on Access instead of the server. So perhaps a ADO Recordset with filters and recordcounts?
Or maybe a 'stored procedure' or 'view'?
Not sure how to make that work, but I could read up on that.
Thanks in advance for your advice.
I am in the process of migrating an Access database to a SQL Server backend. I'm pretty new to SQL Server so I'm learning along the way.
I need to populate a dashboard with multiple recordcounts from the same table, so I'm looking for an efficient way of doing this.
Let's say I have a table in my SQL Server backend called tblOrders.
Relevant columns are OrderID (PK), OrderDate and OrderStatus.
On my dashboard I want to display the number of orders this year, last year, two years ago. Number of orders this year with Status Completed, status pending, status on hold, etc.
In total around 20 recordcounts based on different criteria.
What is the best way to get these numbers?
I can use 20 Dcounts on my linked table, but this puts the workload on Access instead of the server. So perhaps a ADO Recordset with filters and recordcounts?
Or maybe a 'stored procedure' or 'view'?
Not sure how to make that work, but I could read up on that.
Thanks in advance for your advice.