Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count results of select

Status
Not open for further replies.

guitardave78

Programmer
Sep 5, 2001
1,294
GB
Hey all, i have the following query

SELECT date_format(log_date,'%d/%m/%Y') AS dt, count( log_id ) AS count,log_ip
FROM tbl_logs
group by dt,log_ip

what i want is to just produce a count for dt

so the table would look like

dt | dtcount
----------------------
16/04/2007 | 20
17/04/2007 | 25
18/04/2007 | 19

}...the bane of my life!
 
SELECT date_format(log_date,'%d/%m/%Y') AS dt
, count(*) AS dtcount
FROM tbl_logs
GROUP BY dt

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top