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.  Various Data Types

    Employee
    Posted 06-18-2015 00:57

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

    Originally posted by: lauraw_21

    Hi
    I'm really struggling to return a consistant data type to a date field.

    Firstly the field comes through as String
    It has various different date formats within:
    DD-MM-CCYY
    D-M-CCYY
    D/M/CCYY
    AND blanks

    I would like to return just one format DD/MM/CCYY

    Please could someone help?

    Thanks
    Laura


  • 2.  RE: Various Data Types

    Employee
    Posted 06-18-2015 02:37

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

    Originally posted by: ThomasT

    Hi Laura.

    Try this:

    node:Filter
    bretype:core::Filter
    editor:sortkey=55829177282c058d
    input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    prop:Script=<<EOX
    if 'DATE'.isDate("DD-MM-CCYY") then NEWDATE = 'DATE'.date("DD-MM-CCYY") else if
    'DATE'.isDate("D-M-CCYY") then NEWDATE = 'DATE'.date("D-M-CCYY") else if
    'DATE'.isDate("D/M/CCYY") then NEWDATE = 'DATE'.date("D/M/CCYY") else if
    'DATE' == null then NEWDATE = date(null)


    emit *, NEWDATE
    EOX
    editor:XY=250,240
    end:Filter

    node:Static_Data
    bretype:core::Static Data
    editor:sortkey=5582910611d87034
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    DATE
    01-03-2013
    1-mar-2013
    1/mar/2013

    EOX
    editor:XY=170,240
    end:Static_Data