title: time comparison between night time and morning time
body: <p>I have one table that contains two column those contains a integer value</p>
  
  <p><strong>1- StartTime as int
  2-EndTime as int</strong></p>
  
  <p>Now i have to compare hour value from current time with these times.</p>
  
  <p>I am Executing the query if hour value of Current time is greater than starttime and hour value of Current time is less than Endtime IN <strong>24HOURS FORMAT</strong>.</p>
  
  <p>Now the issue is.</p>
  
  <p><strong>If StartTime = 19 and
  Endtime = 7(morning)</strong></p>
  
  <p>If Current hour value returns 20</p>
  
  <p>then   20 > 19 its true  but 20&lt;7 this value getting false....</p>
  
  <p>20 is coming between evening 7 o'clock and morning 7 o'clock...but this query is getting false exception...</p>
  
  <p>Please help me on this.....</p>
  
  <p><strong>I wll be very very highly obliged to u all.....</strong></p>
  
  <p>Again i am explaining this issue in detail</p>
  
  <p>DATEPART(hh,GETDATE()) --- this function will return me a single hour value</p>
  
  <p>Like at 8:00:00PM this will return just 20</p>
  
  <p>in my table i have stored starttime and endtime as Integer value </p>
  
  <p>like  starttime - 19
        endtime - 7</p>
  
  <p>so now that 20 will compare with both values like</p>
  
  <p>20 > 19  ---- true
  20 &lt; 7  ----- this gonna be false </p>
  
  <p>but as per my scenario it should come correct because i am checking night 8 o'clock with morning 7 o'clock    ...... night 8 comes between night 7 and morning 7(this is what i have defined in starttime and endtime)</p>