LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Convert String date/time to date

    Employee
    Posted 08-04-2014 12:27

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: mw9286

    Hello:

    I want to parse a date/time field to 2011-08-14 22:57:19 a date only field.

    I receive the following error when trying this filter logic:

    emit START_DT=date(QUOTE_TS,"CCYY-MM-DD")




    <logEvent id="0" parent="0" chain="0" timestamp="1407180071000" level="WARN">
    <message xsi:type="rawMessage"><![CDATA[cannot parse value ' ' with format 'CCYY-MM-DD']]></message>
    <detail xsi:type="cppDetail" context="parseDate()" line="179" file="build/linux-x86-64/release/code/source/brain/expert/ToDate_ExprOp.cpp" </detail>
    </logEvent>


  • 2.  RE: Convert String date/time to date

    Employee
    Posted 08-04-2014 13:27

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    One of your data values has blanks in it.

    It is better to do it this way:

    q=QUOTE_TS.left(10)
    if isDate(q,"CCYY-MM-DD") then d=date(q,"CCYY-MM-DD") else d = date(null)
    emit START_DT = d