MySQL Forums
Forum List  »  German

Re: Eindeutiger Tag
Posted by: Tanja Gandit
Date: January 01, 2013 09:38AM

Hallo Thomas

Danke für die Antwort. Nun, wenn ich mit DAYOFYEAR(spaltenname) einen Eintrag von z,b. heute hole, dann bekomme ich ja "1", da 1.1.2013.
Aber wenn ich jetzt einen alten Eintrag hole vom 1.1.2012, dann bekomm ich wieder "1" zurück. Das will ich verhindern.

Zu meinem SQL:
Ich hole die Daten raus mit
"SELECT DAYOFYEAR(datum) AS datum2 FROM statistic GROUP BY DAYOFYEAR(datum)"

Für mich von Vorteil wäre, wenn ich anstelle von DAYOFYEAR auf Tag, Monat und Jahr abrufen könnte. Somit wäre dann der Rückgabewert eindeutig, da es nur einmal einen 1.1.2012 gibt und nicht nur den Tag des Jahres (1.1.20xx), der natürlich jedes Jahr wieder den gleich Wert gibt (hier "1"). So dass die Zahl vom 1.1.2012 dann quasi 366 (Anzahl Tage im Jahr 2012) kleiner ist wie die Zahl von heute (1.1.2013).

Ich hoffe, das ist einigermassen verständlich ausgedrückt :)

Liebe Grüsse

Tanja

Options: ReplyQuote


Subject
Views
Written By
Posted
1809
January 01, 2013 05:30AM
898
January 01, 2013 06:12AM
Re: Eindeutiger Tag
1143
January 01, 2013 09:38AM
881
January 01, 2013 10:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.