balram.deswal_1 Posted May 17, 2017 Share Posted May 17, 2017 I have a table (test) in SQL having the data as follows:sampletime samplevalue 2017-05-10 12:17:02.000 100.00 2017-05-10 12:20:02.000 100.002017-05-10 12:23:02.000 100.002017-05-10 12:26:02.000 100.002017-05-10 12:29:04.000 0.00 //capture as start time2017-05-10 12:32:02.000 0.002017-05-10 12:35:02.000 0.002017-05-10 12:38:02.000 0.002017-05-10 12:41:02.000 0.002017-05-10 12:44:02.000 100.00 //capture as end time with above start time2017-05-10 12:47:02.000 100.002017-05-10 12:50:02.000 100.002017-05-10 12:53:02.000 100.002017-05-10 12:56:02.000 0.00 //capture as start time2017-05-10 12:59:02.000 0.002017-05-10 13:02:02.000 0.002017-05-10 13:05:02.000 100.00 //capture as end time with above start time2017-05-10 13:08:02.000 100.002017-05-10 13:11:02.000 0.00 //capture as start time2017-05-10 13:14:02.000 100.00 //capture as end time with above start time2017-05-10 13:17:02.000 100.002017-05-10 13:20:02.000 0.00 //capture as start time2017-05-10 13:23:02.000 0.002017-05-10 13:26:02.000 100.00 //capture as end time with above start time2017-05-10 13:29:02.000 100.002017-05-10 13:32:02.000 100.00 In this table, I want the query that will produce the following output:start time end time2017-05-10 12:29:04.000 2017-05-10 12:44:02.0002017-05-10 12:56:02.000 2017-05-10 13:05:02.0002017-05-10 13:11:02.000 2017-05-10 13:14:02.0002017-05-10 13:20:02.000 2017-05-10 13:26:02.000 Means as soon as the samplevalue gets 0, it records that time as start time and as soon as it becomes 100 again, it records the time as end time.How to design this query and build report in Jasperstudio for this? Thanks & Regards,Balram Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now