Solved

Record count by day / date

Posted on 2011-02-14
4
331 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
[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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

734 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