Hi Guys,
I have a date field and the name of the account. I want to make a view/sp/function that would give me the
1. Number of accounts opend yesterday.
I am using DATEDIFF(D, CONVERT (datetime, DateOpend), GETDATE()) and setting a criteria as 1 and grouping to know the accounts opened.
2. Number of accounts opend This Month.
Another query to sort by date and month using DATENAME(MONTH, DateOpend).
3. Number of accounts opend This Year.
Right now, i am using many queries to reach to the solution.
Is there a better way of handling this information.
I want to see the result the following way.
Accountsopendyesterday ThisMonth Thisyear
32 320 3200
Thanks
Dwight
I have a date field and the name of the account. I want to make a view/sp/function that would give me the
1. Number of accounts opend yesterday.
I am using DATEDIFF(D, CONVERT (datetime, DateOpend), GETDATE()) and setting a criteria as 1 and grouping to know the accounts opened.
2. Number of accounts opend This Month.
Another query to sort by date and month using DATENAME(MONTH, DateOpend).
3. Number of accounts opend This Year.
Right now, i am using many queries to reach to the solution.
Is there a better way of handling this information.
I want to see the result the following way.
Accountsopendyesterday ThisMonth Thisyear
32 320 3200
Thanks
Dwight