• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to get result based on the time

srijith

New Member
Based on the time I need to get the below output


sample data


Products No Time


product1 121 17.33:13

product2 121 17.37:13

product3 123 16:38:45

product4 123 16:50:45


OUTPUT


No From To

121 product1 product2

123 product3 product4
 
Hi Srijith ,


From the example you have given , it is not clear what the time has to do with the output ; for No 121 , the products are product1 and product2 , whereas for No 123 , the products are product3 and product4.


Suppose there are many more products for a particular No. Should the first and last products be output ? Will these be the first and last based on the rows in which they occur e.g. suppose in your example data , product3 had the time 16:50:45 against it , and product4 had the time 16:38:45 against it ; which product would appear under From , and which would appear under To ?


Narayan
 
For no 123 the start time is 16:38:45 and the end time is 16:50:45,so the from will be product3 and To will be product4 for the no 123
 
Hi Srijith ,


I asked you a specific question ; instead of replying to my question , you have just repeated yourself.


I will leave it to others to answer your question.


Narayan
 
sorry abt that the answer to your question is that first and last products should be the output depending upon the time the product got registered,kindly help
 
Hi Srijith ,


No problem. So if I understand you correctly , the earliest time a product code was registered would appear under From , and the latest time a product code was registered , it would appear under To.


The next question is whether these entries can be scattered anywhere in the data , or is your data sorted on No. or product or time ?


For example , will your data be like this :

[pre]
Code:
Product3   157   15:38:35
Product4   157   17:32:35
Product7   157   21:33:45
Product9   157   16:37:45
so that all 157 entries are sorted on product , or will it be like this :

Product3   157   15:38:35
Product9   157   16:37:45
Product4   157   17:32:35
Product7   157   21:33:45
[/pre]
so that all 157 entries are sorted on time ?


Narayan
 
Back
Top