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.  filter on datetime field

    Employee
    Posted 01-12-2015 10:59

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

    Originally posted by: mw9286

    Hello:

    How to I filter on a datetime field? I want to only pull records where the datetime is less than "2014-12-01 21:00:00"

    Thank you,

    Mike


  • 2.  RE: filter on datetime field

    Employee
    Posted 01-12-2015 11:15

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

    Originally posted by: ejones

    Something like this should do it:

    where datetimeValue < datetime(date(2014,12,1),time(21,0,0))


  • 3.  RE: filter on datetime field

    Employee
    Posted 01-16-2015 01:47

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

    Originally posted by: andycooper

    Originally posted by: ejones
    					

    Something like this should do it:

    where datetimeValue < datetime(date(2014,12,1),time(21,0,0))
    The datetime feature creates a long value so the timestamp option is the simplest way to perform the filter without having to convert the other datetime value to long as well.

    Use the following example: -

    where "datetimevalue" < timestamp(date(2014,11,1),time(21,0,0))

    Replace "datetimevalue" with the field name you are using.

    Thanks

    Andy


  • 4.  RE: filter on datetime field

    Employee
    Posted 01-16-2015 07:24

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

    Originally posted by: ejones

    Thanks Andy, yes. It is better to use the timestamp() function than the datetime() function.