Ankündigung

Einklappen
Keine Ankündigung bisher.

day(datum) bei MySQL 4.0.21-Max nicht möglich ?

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • day(datum) bei MySQL 4.0.21-Max nicht möglich ?

    Guten Abend zusammen,
    brauche eure Hilfe, habe gerade die abfrage fertig und auf dem Webserver hochgeladen wo eine andere Version von MySQL drauf ist, und schon gibt es Probleme.

    Beim Ausführen meckert er bei "DAY (datum) AS tag"

    Abfrage:
    Select datum,month(datum) AS monat, day(datum) as tag, Count(*) as anzahl FROM tabelle WHERE datum<='2005-11-29' and datum>='2005-11-29' and trashed='0' GROUP BY monat,tag

    muss ich das unter MySQL 4.0.21-Max anders machen ?

    Vielen Dank

    Cyberbob
    ***********************************
    The only winning move is not to play!
    ***********************************

  • #2
    Hey habs gefunden, in der MySQL Version ist das "dayofweek(datum)".

    Hat sich erledigt, trotzdem danke!
    ***********************************
    The only winning move is not to play!
    ***********************************

    Kommentar


    • #3
      Das sind zwei unterschiedliche Funktionen, die unterschiedliche Werte liefern.
      Zitat von http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
      DAY(date)
      DAY() is a synonym for DAYOFMONTH().
      [...]
      DAYOFMONTH(date)
      Returns the day of the month for date, in the range 1 to 31.
      mysql> SELECT DAYOFMONTH('1998-02-03');
      -> 3
      [...]
      DAYOFWEEK(date)
      Returns the weekday index for date (1 = Sunday, 2 = Monday, ..., 7 = Saturday). These index values correspond to the ODBC standard.
      mysql> SELECT DAYOFWEEK('1998-02-03');
      -> 3

      Kommentar


      • #4
        Oh, das ist gut zu wissen, ist mir gestern abend nicht mehr aufgefallen!

        Für meine Zwecke ist dann dayofmonth interessant!

        Besten dank für die Info!
        ***********************************
        The only winning move is not to play!
        ***********************************

        Kommentar

        Lädt...
        X