Solved

What is this telling me

Posted on 2011-03-06
2
309 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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…

786 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