<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Statistiken erstellen mit SQL anweisung]]></title><description><![CDATA[<p>Hallo,</p>
<p>in meinem Programm habe ich eine Datenbank und ein DBChart mit der ich eine Statistik erstellen möchte.<br />
In meiner Tabelle gibt 2 Werte Datum und Dauer.<br />
Der Wert in der Spalte Datum wird so dargestellt: TT.MM.JJJJ<br />
Der Wert in der Spalte Dauer so: <a href="http://hh.mm" rel="nofollow">hh.mm</a></p>
<p>Nun möchte ich eine Statistik erstellen über die gesamte Dauer in einem Monat. Dabei sollen alles verfügbaren Monate die in der Tabelle drin sind in der YAchse stehen und die gesamte Dauer in der X Achse.<br />
Meine Y Achse ist als &quot;YAchse&quot; und die X Achse als &quot;XAchse&quot; deklariert.<br />
Ich habe das ganze so probiert:</p>
<pre><code class="language-cpp">&quot;Select Sum(Dauer) AS XAchse, MONTH(Datum) AS YAchse FROM Tabelle1 GROUP BY MONTH(DATUM) ORDER BY MONTH(Datum) ASC&quot;
</code></pre>
<p>Kann mir jemand sagen wo mein Fehler liegt?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/164538/statistiken-erstellen-mit-sql-anweisung</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 10:28:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/164538.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Nov 2006 12:37:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 12:37:23 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>in meinem Programm habe ich eine Datenbank und ein DBChart mit der ich eine Statistik erstellen möchte.<br />
In meiner Tabelle gibt 2 Werte Datum und Dauer.<br />
Der Wert in der Spalte Datum wird so dargestellt: TT.MM.JJJJ<br />
Der Wert in der Spalte Dauer so: <a href="http://hh.mm" rel="nofollow">hh.mm</a></p>
<p>Nun möchte ich eine Statistik erstellen über die gesamte Dauer in einem Monat. Dabei sollen alles verfügbaren Monate die in der Tabelle drin sind in der YAchse stehen und die gesamte Dauer in der X Achse.<br />
Meine Y Achse ist als &quot;YAchse&quot; und die X Achse als &quot;XAchse&quot; deklariert.<br />
Ich habe das ganze so probiert:</p>
<pre><code class="language-cpp">&quot;Select Sum(Dauer) AS XAchse, MONTH(Datum) AS YAchse FROM Tabelle1 GROUP BY MONTH(DATUM) ORDER BY MONTH(Datum) ASC&quot;
</code></pre>
<p>Kann mir jemand sagen wo mein Fehler liegt?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171690</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171690</guid><dc:creator><![CDATA[summerset83]]></dc:creator><pubDate>Thu, 09 Nov 2006 12:37:23 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 12:41:51 GMT]]></title><description><![CDATA[<p>was geht nicht?<br />
wie lautet die Fehlermeldung?<br />
welche Datenbank wird verwendet?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171691</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171691</guid><dc:creator><![CDATA[Linnea]]></dc:creator><pubDate>Thu, 09 Nov 2006 12:41:51 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 12:43:21 GMT]]></title><description><![CDATA[<p>Eine Access Datenbank und die Fehlermeldung lautet &quot;Datentypen in Kriterienausdruck unverträglich&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171692</guid><dc:creator><![CDATA[summerset83]]></dc:creator><pubDate>Thu, 09 Nov 2006 12:43:21 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 12:47:44 GMT]]></title><description><![CDATA[<p>Hallo</p>
<blockquote>
<p>Nun möchte ich eine Statistik erstellen über die gesamte Dauer in einem Monat. Dabei sollen alles verfügbaren Monate die in der Tabelle drin</p>
</blockquote>
<p>Ich habe dir doch bereits schon gesagt, das MONTH nur die reinen Monate vergleicht, aber keinen Unterschied zwischen den Jahren macht! Also wäre zum Beispiel der 2.10.2005 im selben Monat wie der 2.10.2006.<br />
Du must dann ebenfalls noch das Jahr vergleichen.</p>
<p>Tip : teste die Abfrage mit einem geeigneten Frontend (in deinem Fall MS Access selber), und las dich ins DB-Forum verschieben, denn mit dem Builder hat das ja nichts mehr zu tun.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171695</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171695</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 09 Nov 2006 12:47:44 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 12:52:13 GMT]]></title><description><![CDATA[<p>sind die Spalten &quot;Datum&quot; und &quot;Dauer&quot; vom Typ DateTime? oder sind das Textspalten?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171700</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171700</guid><dc:creator><![CDATA[Linnea]]></dc:creator><pubDate>Thu, 09 Nov 2006 12:52:13 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 14:28:22 GMT]]></title><description><![CDATA[<p>Datum ja, die Dauer ist aber eine Textspalte, was funktionieren müsste denn nur Datum muss dem Typ DateTime zugeordnet werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171716</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171716</guid><dc:creator><![CDATA[summerset83]]></dc:creator><pubDate>Thu, 09 Nov 2006 14:28:22 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 14:51:52 GMT]]></title><description><![CDATA[<p>Wäre mir neu, dass man, ohne zu casten, Textspalten addieren kann...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171728</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Thu, 09 Nov 2006 14:51:52 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 15:03:20 GMT]]></title><description><![CDATA[<p>Es geht aber, dort stehen ja nur Zahlen drin. Habe schon mit dieser Spalte ander Statistiken erstellen lassen und es funktioniert, daran liegt also nicht das Problem.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171740</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171740</guid><dc:creator><![CDATA[summerset83]]></dc:creator><pubDate>Thu, 09 Nov 2006 15:03:20 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 15:18:40 GMT]]></title><description><![CDATA[<p>Ok, es geht!<br />
Der Fehler lag an einer Einstellung von DBChart, also so wie ich den Quelltext bzw. die SQL Anweisung gepostet habe funktionierts.<br />
Jetzt aber noch eine kleine Frage zum Schluss.</p>
<p>In meinem DBChart werden nun unten (YAchse) die Monate in 01 02 03 04...angezeigt. Ich möchte aber das dort Jan Feb Mrz Apr steht, kann ich die Ergebnisse von der SQL Abfrage ändern, wenn ja wie????????</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171745</guid><dc:creator><![CDATA[summerset83]]></dc:creator><pubDate>Thu, 09 Nov 2006 15:18:40 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 15:25:39 GMT]]></title><description><![CDATA[<p>So spontan fallen mir da berechnete Felder ein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171752</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171752</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Thu, 09 Nov 2006 15:25:39 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 15:28:45 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>also noch einmal</p>
<p>akari schrieb:</p>
<blockquote>
<p>Ich habe dir doch bereits schon gesagt, das MONTH nur die reinen Monate vergleicht, aber keinen Unterschied zwischen den Jahren macht! Also wäre zum Beispiel der 2.10.2005 im selben Monat wie der 2.10.2006.<br />
Du must dann ebenfalls noch das Jahr vergleichen.</p>
</blockquote>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171758</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171758</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 09 Nov 2006 15:28:45 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 15:28:57 GMT]]></title><description><![CDATA[<p>Und das heißt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171759</guid><dc:creator><![CDATA[summerset83]]></dc:creator><pubDate>Thu, 09 Nov 2006 15:28:57 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Thu, 09 Nov 2006 15:50:50 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>das sollte ungefähr so aussehen</p>
<pre><code>Select Sum(Dauer) AS XAchse, CONCAT(MONTH(Datum), '-', YEAR(Datum)) AS YAchse FROM Tabelle1 GROUP BY MONTH(Datum), YEAR(Datum) ORDER BY YEAR(Datum), MONTH(Datum) ASC
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171778</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171778</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 09 Nov 2006 15:50:50 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Fri, 10 Nov 2006 06:32:09 GMT]]></title><description><![CDATA[<p>Mit &quot;Und das heißt&quot; war die Frage auf die Antwort Jow_M bezogen. Ich weiß selbst das ich die Jahre noch Filtern muss. Das ist aber jetzt nicht mein Problem.<br />
Ich möchte wissen wie ich die Anzeige im DBChart auslese und anders beschrifte z.B 01=Jan 02=Feb usw.</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171911</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171911</guid><dc:creator><![CDATA[summerset83]]></dc:creator><pubDate>Fri, 10 Nov 2006 06:32:09 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Fri, 10 Nov 2006 08:47:46 GMT]]></title><description><![CDATA[<p>Nun ja, im Feldeditor der Query klickst Du mit der rechten Maustaste und wählst 'Neues Feld'. Wichtig ist, dass Du 'berechnet' anwählst und den Typ auf String stelltst. Größe 3 sollte reichen (wenn Du immer nur 3 Buchstaben haben willst. Wenn Du das Feld angelegt hast, schaust Du die Methode GetText() an. Dort wertest Du die Monatszahl aus und gibst den Monatsstring in der Variable Text zurück.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171960</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171960</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 10 Nov 2006 08:47:46 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Fri, 10 Nov 2006 09:40:15 GMT]]></title><description><![CDATA[<p>Habe mir die Methode angeschaut. Habe aber dazu kein Bespiel gefunden und verstehe nicht so ganz wie ich nun die Variablen auslese und diese umbenenne bzw. in mein DBChart bringe.</p>
<p>Bitte noch eine kleine Hilfe!</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1172013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1172013</guid><dc:creator><![CDATA[summerset83]]></dc:creator><pubDate>Fri, 10 Nov 2006 09:40:15 GMT</pubDate></item><item><title><![CDATA[Reply to Statistiken erstellen mit SQL anweisung on Fri, 10 Nov 2006 10:06:44 GMT]]></title><description><![CDATA[<p>Im DBChart steht sie dir wie eine ganz normales Feld aus der Tabelle zur Verfügung. In der GetText() mußt Du sie nur mit 'beleben'.</p>
<p>Das könnte zB so aussehen:<br />
Das Feld habe ich 'Monatsname' benannt.</p>
<pre><code class="language-cpp">void __fastcall TForm1::ADOQuery1MonatsnameGetText(TField *Sender,
		AnsiString &amp;Text, bool DisplayText)
{
	// Format YAchse MM-YYYY
	AnsiString YAchse = ADOQuery1-&gt;FieldByName(&quot;YAchse&quot;)-&gt;AsString;
	if (YAchse.AnsiPos(&quot;-&quot;))
	{
		int iPos = YAchse.AnsiPos(&quot;-&quot;);
		int iMonat = YAchse.SubString(1, pos - 1).ToInt(); // Monat als int ermitteln
		YAchse = YAchse.Delete(1, pos); // YAchse enthält jetzt nur noch die Jahreszahl
		switch (iMonat)
		{
		  case 1: Text = &quot;Jan&quot;;
		  break;
		  // díe restlichen hier einfügen...
		  case 12: Text = &quot;Dez&quot;;
		  break;
		}
		Text += &quot; &quot; + YAchse; // Jahreszahl wieder anhängen
	}
	else
		Text = &quot;FEHLER&quot;;
}
</code></pre>
<p>Da fehlt natürlich noch ein bißchen was an Überprüfungen... (es gibt z.B. ne böse Fehlermeldung, wenn ToInt() fehlschlägt)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1172030</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1172030</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 10 Nov 2006 10:06:44 GMT</pubDate></item></channel></rss>