Ashu Rawat

Ashu Rawat

  • NA
  • 8
  • 7.6k

Problem in Time comparison

May 17 2013 3:45 AM
Hi,


I am facing a problem while compare time with given time..

I am explaining this in detail.
please go through this.And please help me..


I have one table that contains two column those contains a interger value

1- StartTime as int
2-EndTime as int

Now i have to compare hour value from current time with these times.

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 24HOURS FORMAT.

Now the issue is.

If StartTime = 19 and
Endtime = 7(morning)


If Current hour value returns 20

then   20 > 19 its true  but 20<7 this value getting false....

20 is coming between evening 7 o'clock and morning 7 o'clock...but this query is getting false exception...

Please help me on this.....

I wll be very very highly obliged to u all.....

Answers (1)