Statistique par jours

Résolu
geek1983 Messages postés 16 Date d'inscription mardi 18 mars 2008 Statut Membre Dernière intervention 11 septembre 2009 - 30 janv. 2009 à 16:39
geek1983 Messages postés 16 Date d'inscription mardi 18 mars 2008 Statut Membre Dernière intervention 11 septembre 2009 - 30 janv. 2009 à 17:10
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CGABRIE%7E1.TIC%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tableau Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->
Bonjour, j'ai un petit "problème " que je
vais essayer d'expliquer le plus clairement possible.


J'ai une basse de donnée contenant des "logs " d'appel.

J'aimerais pouvoir dire en moyenne combien d'appels il y a pour chaque jour de
la semaine.


Ex. : Dans toute cette base de données, il y a une moyenne de 34 appels
par jour le lundi.


Pour déterminer combien d'appels il y a le lundi, je dois calculer le nombre de
fois que "lundi " apparait dans la base de données.


Mon problème est que les dates s'affichent dans le format "datetime "
(2008-10-21  14:42:34)...


Quelqu'un serait’ il en mesure de m'aider?







Merci.

2 réponses

kohntark Messages postés 3705 Date d'inscription lundi 5 juillet 2004 Statut Membre Dernière intervention 27 avril 2012 30
30 janv. 2009 à 16:59
Salut,

Tu peux traiter ça en php mais le mieux est de le faire directement dans la requête SQL, par exemple :
Retrait de tous les lundis présents dans ta table :
SELECT * FROM `machin` WHERE DATE_FORMAT(date, '%w') = 1

Cordialement,

Kohntark -
3
geek1983 Messages postés 16 Date d'inscription mardi 18 mars 2008 Statut Membre Dernière intervention 11 septembre 2009
30 janv. 2009 à 17:10
Trop fort, merci à toi lol
0
Rejoignez-nous