4 Replies Latest reply: Mar 26, 2015 8:32 AM by Ruben Marin RSS

    Incorrect date presentation

    Виталий Чуприна

      I use following code to load date from file:

       

      LET vDateRAW = subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1);

      LET vDateDay = num(subfield (subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1), '/', 2), 00);

      LET vDateMonth = num (subfield (subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1), '/', 1), 00);

      LET vDateYear = num (subfield (subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1), '/', 3), 0000);

       

      LET vWEEK =$(vDateYear) & $(vDateMonth) & $(vDateDay);

      .

      .

      .

      $(vWEEK) AS WEEK_ENDING_DATE

       

      When I add WeekStart Function

       

      WeekStart($(vWEEK)) AS WEEK_ENDING_DATE,

       

      Date column start looking incorrect :

      05/24/57069

      What should I do to load week start date in correct format (example '20150207')?