Date issues within LPA

 3 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Frankie Hennessey
Posts: 5
    I am trying to convert a String Date with a format of mm/dd/yyyy received from a query of a table into an AGS format of yyyymmdd. I have tried a number of DATE to string and String to DATE functions but none of them are working. Could there be something wrong with one of our LPA setup functions?  Has anyone else been having Date conversion issues?
    Woozy
    Veteran Member
    Posts: 709
    Veteran Member
      HI Frankie Hennessey,

      You should be able to do it like this:

      InputValue (string) ={date in "mm/dd/yyyy" string format}
      OutputValue (string) = getDateAGS(pfDate(InputValue,'mm/dd/yyyy'))

      Resulting OutputValue is:  "yyyymmdd"

      I just tried this with a simple flow and it worked file.  We're using LSF 9.0.1.11 and IPA 9.2.5 but it should work on v10 as well.

      Good Luck!

      Kelly
      Kelly Meade
      J. R. Simplot Company
      Boise, ID
      Frankie Hennessey
      Posts: 5
        That did it. I was using the pfDate(var1, yyyymmdd) since I wanted it converted to the yyyymmdd. I didn't realize it was converting it to a date format based on the string value so that I could then convert to AGS. Excellent. Thanks for the fast help.
        Frankie Hennessey
        Posts: 5
          I also did some function nesting which works well also. This is taking a script date converting to a date format, adding a day, then converting it back to a script.
          getDateDME(AddDay(pfDate(GM12DETAIL_BEGIN_DATE,'mm/dd/yyyy'),1))