Dishant Kumar Yadav
Dishant Kumar Yadav

Reputation: 13

getting NULL when i am trying to Record the response time

I am using this to get the response time

GREATEST(0, TIMESTAMPDIFF(SECOND, createdAt, replied_at)) AS response_time,

But its showing NULL,

Given that createdAt and replied_at is in UNIX timestamp createdAt, repliedAt and response_time all are BIGINT I want the response time which is the difference of replied_at minus createdAt in seconds

Upvotes: -1

Views: 43

Answers (1)

Danish Mehmuda
Danish Mehmuda

Reputation: 5

The 2nd and 3rd fields in TIMESTAMPDIFF() function should not be in UNIX time. Refer this article: TIMESTAMPDIFF() usage

Upvotes: -1

Related Questions