Given this query
SELECT
[InputEH].session, [InputEH].event, datediff(second, [InputEH].event_start, [InputEH].event_end) AS "duration"
INTO
[SessionEventTable]
FROM
[InputEH]
and this test json:
[{
"session": "session123",
"event": "access",
"event_start": "2017-02-22T9:58:00.12345Z",
"event_end": "2017-02-22T10:03:30.12345Z"
}]
the 'Test' function in ASA returns:
Cannot cast value '2017-02-22T9:58:00.12345Z' to type 'datetime' in expression 'datediff ( second , [InputEH] . event_start , [InputEH] . event_end )'.
Am I missing something here? It seems this should work. As an aside, if I remove the quotes around "2017-02-22T9:58:00.12345Z"
, it parses, but it doesn't work; I don't think this is right though, because the quotes should be there in the JSON input.
Yikes - apparently "2017-02-22T9:58:00.12345Z"
needs to be "2017-02-22T09:58:00.12345Z"
. Problem solved.