2 Replies Latest reply on Jan 19, 2014 8:47 PM by tomo17

    Extracting date from text

    tomo17

      Title

      Extracting date from text

      Post

           I have a field that has imported the date as a text e.g. Monday, January 25, 2013

           I have tried the calculation

      Let ( Month = Ceiling ( Position ( "JanFebMarAprMayJunJulAugSepOctNovDec" ; Left ( DateText ; 3 ) ; 1 ; 1 ) / 3 ) ;
              Date ( Month ; MiddleWords ( DateText ; 2 ; 1 ) ; Rightwords ( DateText ; 1 ) )
            )

      But this is not working.  I get how it works but am not sure how I can change it to work.  I would like to get an answer such as 25/1/2013

            

      Thanks in advance

        • 1. Re: Extracting date from text
          philmodjunk

               Problem is that day name that starts the text. Left ( DateText ; 3 ) is returning "Mon" instead of "Jan" and thus the calculation doesn't compute a number for the month.

          Let ( Month = Ceiling ( Position ( "JanFebMarAprMayJunJulAugSepOctNovDec" ; Left ( MiddleWords ( DateText ; 2 ; 1 ) ; 3 ) ; 1 ; 1 ) / 3 ) ;
                  Date ( Month ; MiddleWords ( DateText ; 3 ; 1 ) ; Rightwords ( DateText ; 1 ) )
                )

          • 2. Re: Extracting date from text
            tomo17

                 Perfect - thanks.

                 As usual your advice is superb!