title: Composite Key formation for a date range in Hyperledger Fabric V1.0
body: <p>With reference to <a href="https://stackoverflow.com/questions/44918611/composite-key-functions-in-hyperledger">this</a> question, I also have a doubt.
  <br/> Suppose my composite key is formed with the fields <code>Owner_id~dateOfcreation</code>
  and my keys are like:</p>
  
  <blockquote>
    <ul>
    <li>Owner1~11-05-2017</li>
    <li>Owner1~12-05-2017</li>
    <li>Owner1~13-05-2017</li>
    <li>...</li>
    <li>...</li>
    <li>Owner1~30-05-2017</li>
    </ul>
  </blockquote>
  
  <p>Will it be possible for me to get states for a <strong><code>date range</code></strong> for example <code>Owner1~12-05-2017 to Owner~27-05-2017</code>?</p>
  
  <p>In my understanding <code>stub.GetStateByRange(startKey,endKey)</code> will return the keys which are in lexical order, so it will not return the expected range.
  Correct me if I am wrong.</p>
  
  <p>I tried to re-arrange the keys like:</p>
  
  <blockquote>
    <ul>
    <li>Owner1~2017_05_11</li>
    <li>Owner1~2017_05_12</li>
    <li>Owner1~2017_05_13</li>
    <li>...</li>
    <li>...</li>
    <li>Owner1~2017_05_30</li>
    </ul>
  </blockquote>
  
  <p>In this case if i use
   <br/><code>stub.GetStateByPartialCompositeKey('owner~year~month~day',[]string{"owner1","2017","05"})</code> it will return all the keys starting with these range. is it correct?</p>
  
  <p>But here also I am not getting my exact output for a <strong><code>date range</code></strong>.</p>
  
  <p>Can anyone suggest me the proper way to implement this. I think it is a common business scenario in the context of asset sharing, so please help.</p>
  
  <p>Thanks in advance :)</p>