ChrisB: Datum berechnen

Beitrag lesen

Hi,

Wie meinst du das?
Gleich eine solche Funktion in der MySQL Abfrage einbauen?
Geht das denn mit MySQL alleine?

Na klar geht das … schau dir mal die Datums- und Zeitfunktionen an – ADDDATE/SUBDATE kannst du in DATEDIFF „einbauen“ … und wenn du das dann noch mit einer Control Flow Function wie CASE kombinierst, kannst du dir damit gleich ein simples „Flag“ zurück liefern lassen, sowas wie bspw. -1/0/1, anhand dessen deine Ausgabelogik (JavaScript, oder serverseitige Sprache) dann entscheiden kann, welcher Fall vorliegt.

MfG ChrisB

--
Autocomplete has spoiled me to a point where it happens every so often that I encounter a CAPTCHA, and I just type in the first character … and then wait for the rest of the code to be automatically suggested :/