Solved

What is this telling me

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server Error Log - logging period 1 33
DATETIMEOFFSET feature 1 33
Insert Salary Period that has 2 months 11 25
AWE-based memory on 32-bit servers 1 23
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now