List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 26 1999 9:10pm
Subject:About ISO week # formatting in MySQL
View as plain text  
>>>>> "Juan" == Juan Riera <jriera@stripped> writes:

Juan> For some weeks I have been trying to find alternatives to week() function on
Juan> MySQL allowing to format dates (datetime field) as week number using ISO
Juan> format (first week of the year is week with the first thursday on it, or
Juan> week with four complete days). I have found perl and PHP alternatives, but I
Juan> definitely need a MySQL function as I need to group data on SQL query, and
Juan> not only formatting dates. As I am not a C programmer, I have not tried to
Juan> develop a MySQL function to do this date formatting, but I wonder if (a)
Juan> could it be done, and (b) has anyone a valid alternative for grouping values
Juan> on iso week number as a result of an MySQL query.
Juan> Anyway, I send to you my humble request to find this option on new MySQL
Juan> versions as a new option added to week() function!

Juan> Regards,
Juan> Juan

Hi!

Note that both the WEEK() function and DATE_FORMAT() can handle weeks
that starts with Sunday or Monday (another way too look at your week
problem).

Just take a look in the MySQL manual for the above functions!

Regards,
Monty
Thread
About ISO week # formatting in MySQLJuan Riera26 Sep
  • About ISO week # formatting in MySQLMichael Widenius26 Sep
  • RE: About ISO week # formatting in MySQLJuan Riera27 Sep
    • RE: About ISO week # formatting in MySQLAldrian Gintingsuka27 Sep
    • RE: About ISO week # formatting in MySQLMichael Widenius27 Sep
      • RE: About ISO week # formatting in MySQLbkline28 Sep
        • RE: About ISO week # formatting in MySQLPeter Strömberg28 Sep
      • Re: About ISO week # formatting in MySQLMartin Ramsch28 Sep
        • Re: About ISO week # formatting in MySQLPeter Strömberg28 Sep
          • Re: About ISO week # formatting in MySQLAldrian Gintingsuka28 Sep
            • Re: About ISO week # formatting in MySQLMartin Ramsch28 Sep
            • Re: About ISO week # formatting in MySQLBob Kline28 Sep
          • Re: About ISO week # formatting in MySQLMatthias Urlichs28 Sep
            • Re: About ISO week # formatting in MySQLPeter Strömberg28 Sep
              • Re: About ISO week # formatting in MySQLMichael Widenius29 Sep
            • Re: About ISO week # formatting in MySQLBob Kline28 Sep
              • Re: About ISO week # formatting in MySQLMatthias Urlichs29 Sep
          • RE: About ISO week # formatting in MySQLJuan Riera30 Sep
            • Re: About ISO week # formatting in MySQLMartin Ramsch30 Sep
        • Re: About ISO week # formatting in MySQLMartin Ramsch28 Sep
          • Re: About ISO week # formatting in MySQLBob Kline28 Sep
            • Re: About ISO week # formatting in MySQLMartin Ramsch28 Sep
              • Re: About ISO week # formatting in MySQLBob Kline28 Sep
                • Re: About ISO week # formatting in MySQLMartin Ramsch28 Sep
                  • Re: About ISO week # formatting in MySQLBob Kline29 Sep
                • Re: About ISO week # formatting in MySQLMartin Ramsch29 Sep