Problmes with count from records of 00:00 to 12:00

This is a discussion on Problmes with count from records of 00:00 to 12:00 within the MySQL Database forums, part of the Database Forums category; $sql = "select DATE_FORMAT(date,'%d.%m.%Y') as datum, count( id )AS anzahl, id from statistik GROUP BY datum ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-18-2007
Sabine Weggner
 
Posts: n/a
Default Problmes with count from records of 00:00 to 12:00

$sql = "select DATE_FORMAT(date,'%d.%m.%Y') as datum,
count( id )AS anzahl,
id

from

statistik

GROUP BY

datum

LIMIT 60";


Now i become 60 records.
But i want separate records of 00:00-12:00 and 12:01- 23:59 pre day.
I think i make that's with count.
But how?


Sabine


Reply With Quote
  #2 (permalink)  
Old 07-18-2007
lark
 
Posts: n/a
Default Re: Problmes with count from records of 00:00 to 12:00

== Quote from Sabine Weggner (sab12121xx@gmx.de)'s article
> $sql = "select DATE_FORMAT(date,'%d.%m.%Y') as datum,
> count( id )AS anzahl,
> id
> from
> statistik
> GROUP BY
> datum
> LIMIT 60";
> Now i become 60 records.
> But i want separate records of 00:00-12:00 and 12:01- 23:59 pre day.
> I think i make that's with count.
> But how?
> Sabine


i guess you can add a where clause to this query to only retrieve records of 00-12
and then write another one with a predicate for 12-24. is that what you are asking?
--
POST BY: lark with PHP News Reader
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:59 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0