Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Count number of entries per day

Posted on 2011-02-23
6
Medium Priority
?
516 Views
Last Modified: 2012-05-11
Hi

I need to count the numbers of entries per day in a database.

Then I need the result to be displayed so that I can see how many entries there were per day.

0
Comment
Question by:jensjakobsen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 34963879

select convert(datetime, datefield, 101) as Daily, Count(*)
from table
group by Daily
0
 
LVL 1

Author Comment

by:jensjakobsen
ID: 34963928
Thanks for a very quick response.

However that example showed me the number of 1 (one) per entry.

Example:

If the date 02/02/2011 had 12 entries I get 12 entries and not 02/02/2011 = 12

Let me know if I'm unclear.
0
 
LVL 18

Accepted Solution

by:
sventhan earned 2000 total points
ID: 34963945
select convert(varchar, datefield, 110) as Daily, Count(*)
from table
group by convert(varchar, datefield, 110)
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 1

Author Comment

by:jensjakobsen
ID: 34963988
Superb!!

I love you.
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 34964073
Missed the group by
0
 
LVL 41

Expert Comment

by:Sharath
ID: 34964362
You can simply convert to DATE if you are on SQL Server 2008.
select convert(date, datefield) as Daily, Count(*) Cnt
from table1
group by convert(date, datefield)

Open in new window

0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

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 …
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

618 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