Solved

Record count by day / date

Posted on 2011-02-14
4
305 Views
Last Modified: 2012-06-27
Hi All,

What would be the sql for a record count by date for this table?

select txn_id, labelid, value, months, date, proc_dd, proc_mm,proc_yyyy from history

Thanks
0
Comment
Question by:lp84
4 Comments
 
LVL 8

Expert Comment

by:kingjely
ID: 34893686
select count(txn_id) as count, txn_id, labelid, value, months, date, proc_dd, proc_mm,proc_yyyy from history
group by day(date)

Something like the above

0
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 34893725
like this probably

if you want more we need the data types of the columns and some sample
data would also be nice....


select proc_yyyy,proc_mm,proc_dd,count(*) as records
from history
group by proc_yyyy,proc_mm,proc_dd
order by 1 desc,2 desc,3 desc

Open in new window

0
 

Author Comment

by:lp84
ID: 34893742
they are all text and value is numeric and date is date
0
 
LVL 23

Accepted Solution

by:
Rajkumar Gs earned 500 total points
ID: 34893897
select date, count(*) as recordcount  from history
group by date
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ODBC Question 3 30
SQL - How to list all tables participating in a query 7 43
Adding Subtracting values in sql server 5 19
SQL VIEW 7 20
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

920 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

14 Experts available now in Live!

Get 1:1 Help Now