8 Replies Latest reply: Mar 31, 2016 7:18 AM by Sunny Talwar RSS

    Real Long Month Names, sorted by number of month, not alphabetical order

    Christoph Schlunegger

      Hi all,


      I'a aware that this is a well documented topic. However, I haven't found the answer to the solution I need for a Master Calendar. I have set the formats as follows:


      SET MonthNames='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';

      SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';

      SET LongMonthNames='Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember';

      SET LongDayNames='Montag;Dienstag;Mittwoch;Donnerstag;Freitag;Samstag;Sonntag';


      LET vTempDate = Today();


      Then I generate a temporal table with daily dates, based on the variable vTempDate. Then I reload this temporal table and calculate all kind of "handles" to be used later with the GUI. Part of the script is as follows


      WeekDay (vTempDate) as Wochentag,

      date(vTempDate,'WWWW') as WochentagLang,

      Week(vTempDate) as Woche,

      num(Month(vTempDate)) as Monat,

      month(date(vTempDate, 'MMMM')) as MonatLong,

      month(vTempDate) as Monat_Name,



      Now, the handle I'm still missing is MonatLong. That should read Januar, Februar, März, etc. with the underlying number of the month for sorting in the correct manner. However, all I have achieved so far, is that MonatLong comes out as Jan, Feb, Mrz,....


      I also tried to generate  long month names using

      if(num(Month(vTempDate)) = 1,'Januar',if(num(Month(vTempDate))=2,'Februar',if(num(Month(vTempDate))=3,'März',if(...


      Date#(date(vTempDate, 'MMMM')) as MonatLong,


      But then the correct sorting order (according to number of Month) is lost and MonatLong just sorts in an alphabetical order.


      Anyone any ideas?  Thanx and kind regards