Hello Experts.
In onre of the requirements, I need to find out Date difference between two datetimes entered as DC.
DC Parameter name: START_TIME , Type: Text , Mask: ##:## ##/##/#### , Value: 10:12 05/31/2016
DC Parameter name: END_TIME , Type: Text , Mask: ##:## ##/##/#### , Value: 11:11 05/31/2016
DC Parameter name: TOTAL_TIME , Type: Formula
I have swritten script as: (I have hardcoded ENDTIME as just wantes to see whetehr query works or not)
queryStr = "select datediff(mi , (substring(\'" + START_TIME + "\' , 13 , 4) + \'-\' + substring(\'" + START_TIME + "\' , 7 , 2) + \'-\' + substring(\'" + START_TIME + "\' , 10 , 2) +\'T\' + substring(\'" + START_TIME + "\', 1 , 5) + \':00\' ) , '2016-05-31T11:11:00') AS MINS";
result = executeQuery(queryStr);
TotalTime = result.get("MINS");
exit(TotalTime);
But when I perfrom Data Collect, it gives me an error sayong aht START_TIME is not defined.
What am I doing wrong here? Or is it that formula/scripts will take only numeric fields even if I am passing it as parameter?
Is there any other method to achieve the same?
Regards,
Soham