Query Kpi_Data using pdm_extract with kpi_time_stamp
search cancel

Query Kpi_Data using pdm_extract with kpi_time_stamp

book

Article ID: 273524

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager

Issue/Introduction

I am trying to extract the kpi data for a year using pdm_extract but this command gives me an Error in fetch 

pdm_extract -f "select kpi_id, kpi_time_stamp, kpi_value from Kpi_Data where kpi_id = 8838 and kpi_time_stamp >= DATE'2022-09-13'"

what am i doing wrong?

Environment

Release : 17.3

Resolution

The right command should be

pdm_extract -f "select kpi_id, kpi_time_stamp, kpi_value from Kpi_Data where kpi_id = 8838 and kpi_time_stamp >= 1663041600"

the kpi_time_stamp is an Unix time stamp and you would need to convert it into an integer. For 2022-09-13 it is 1663041600

https://www.unixtimestamp.com/