Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

mysql: DATE_FORMAT

Empfohlene Antworten

Veröffentlicht

ich lese aus der datenbank einträge aus, jeder eintrag besitzt ein datum im format YYYY-MM-DD HH:ii:ss.

mit der funktion DATE_FORMAT von mysql hole ich mir von meinem datum das jahr und den monat.

meine abfrage sieht so aus


	                SELECT

	                    DATE_FORMAT(datum,'%m/%x') AS ausgabe_format,

	                    count(sessionid) AS count

	                FROM

	                    nc_activity

	                WHERE

	                    referrer like 'http://www.google%' AND

	                    TO_DAYS('$startdatum') <= TO_DAYS(nc_activity.datum) AND

	                    TO_DAYS('$stopdatum') >= TO_DAYS(nc_activity.datum)

	                GROUP BY

	                    ausgabe_format

folgendes bekomme ich zurück:

ausgabe_format count

01/2007 1640

02/2007 1418

03/2007 1861

04/2007 1470

05/2007 1523

06/2007 1787

07/2007 1839

08/2007 1616

09/2007 2032

10/2007 1984

11/2007 2097

12/2007 1595

12/2008 24

01/2008 727

wie kommt er darauf?

das macht er nur bei den einträgen mit 2007-12-31 ...

verstehe das nicht?!

wie kommt er darauf?

das macht er nur bei den einträgen mit 2007-12-31 ...

verstehe das nicht?!

Guckst du hier:

%x Jahr der Woche, wobei Montag der erste Tag der Woche ist, numerisch, vierstellig; wird mit %v verwendet

Der 31.12 war ein Montag und gleichzeitig der erste Tag der Woche 1 (des Jahres 2008). Also stimmt die Ausgabe doch. ;)

danke.

habe es nun erstmal mit %X gelöst anstatt mit %x, so ist sonntag der erste tag.

sollte erstmal für mind. 1 jahr nun gefixt sein.

thx

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.