Solved

What is this telling me

Posted on 2011-03-06
2
311 Views
Last Modified: 2012-05-11
Is  this query telling me how many users entries were made in my aspnet_Profile table on the particular dates? If so How do I request the total entries for a particular date/month/year.
SELECT Dateadd(day, Datediff(day, 0, LastUpdatedDate), 0) as CreatedOn, Count('UserId') as [Count]
FROM aspnet_Profile
GROUP BY Dateadd(day, Datediff(day, 0, LastUpdatedDate), 0)
ORDER BY 1

2011-02-15 00:00:00.000	145
2011-02-16 00:00:00.000	1196
2011-02-17 00:00:00.000	8046
2011-02-18 00:00:00.000	162
2011-02-19 00:00:00.000	145
2011-02-20 00:00:00.000	4648
2011-02-21 00:00:00.000	4546

Open in new window

0
Comment
Question by:ruffone
2 Comments
 
LVL 15

Accepted Solution

by:
derekkromm earned 500 total points
ID: 35051317
yes

if you want a particular day, you would do this:

SELECT Count('UserId') as [Count]
FROM aspnet_Profile
WHERE Dateadd(day, Datediff(day, 0, LastUpdatedDate), 0) = '<yourdatehere>'

for a particular month:

SELECT Count('UserId') as [Count]
FROM aspnet_Profile
WHERE MONTH(LastUpdatedDate) = '1' and YEAR(LastUpdatedDate) = '2011'

or the count for each month:


SELECT  MONTH(LastUpdatedDate) as [Month], YEAR(LastUpdatedDate) as [Year], Count('UserId') as [Count]
FROM aspnet_Profile
GROUP BY MONTH(LastUpdatedDate), YEAR(LastUpdatedDate)
ORDER BY 2, 1
0
 
LVL 4

Author Closing Comment

by:ruffone
ID: 35068574
Thanks
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question