Milo_Dev
Milo_Dev

Reputation: 415

Kusto - Arithmetic expression cannot be carried-out between DateTime and String

Below Query does not return result gives an error message - Arithmetic expression cannot be carried-out between DateTime and StringBuffer

How do I solve this pls

| extend Time=format_datetime(Testtime,'yyyy-MM-dd h:m:s.fffffff') 
| facet by Time,Status,ID
| extend minutes = (now() - Time)/60
| project minutes, ID
| limit 1```

Upvotes: 0

Views: 2061

Answers (2)

Yoni L.
Yoni L.

Reputation: 25895

Time is of type string, and now() is of type datetime

  • The operation now() - Time isn't supported, as the error message suggests: Arithmetic expression cannot be carried-out between DateTime and StringBuffer

It appears Testtime is of type datetime

  • Did you intend to use now() - Testtime instead?

Upvotes: 2

Avnera
Avnera

Reputation: 7608

The facet operator returns multiple tables, thus it cannot be followed by another operator.

Upvotes: 1

Related Questions