Solved

What is this telling me

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

13 Experts available now in Live!

Get 1:1 Help Now