0

my table is like this

|id|start_time|end_time|start_date|end_date  |
|01| 10:00Am  | 10:PM  |2014-08-19|2014-08-30|

i want to find my specific date between two columns start_date and end_date

select start_time,end_time
from table 
where 2014-08-24 <= end_date and >= start_date

how can i find my specific date

Abhik Chakraborty
  • 44,654
  • 6
  • 52
  • 63

2 Answers2

0

I think you only need to use between condition:

select start_time,end_time
from table
where '2014-08-24' between start_date and end_date
kiks73
  • 3,718
  • 3
  • 25
  • 52
0

You should use date in db rows, try this way

SELECT `start_time`, `end_time`
FROM `table` 
WHERE `start_date` <= "2014-08-24" AND `end_date` >= "2014-08-24"
Girish
  • 11,907
  • 3
  • 34
  • 51