I've a table where there are 8 columns and 2 of them are To
& From
these are having datatype of datetime. I want to execute a select query with some filter on those two fields.
Now see the following example
Record X = From "5 May" to "18 May"
Filter 1: from "5 May" to "5 May" … x should show
Filter 2: from "10 May" to "10 May" … x should show
Filter 3: from "1 May" to "1 May" … x should NOT show
Filter 4: from "19 May" to "19 May" … x should NOT show
Filter 5: from "18 May" to "18 May" … x should show
Filter 6: From "4 May" to "17 May" …. X should show
Filter 7: From "4 May" to "18 May" …. X should show
Filter 8: From "4 May" to "19 May" …. X should show
Filter 9: From "5 May" to "17 May" …. X should show
Filter 10: From "5 May" to "18 May" …. X should show
Filter 11: From "5 May" to "19 May" …. X should show
Filter 12: From "2 May" to "3 May" …. X should NOT show
Filter 13: From "20 May" to "25 May" …. X should NOT show
So Basically the logic is if any date are common in between the filter date range and the database date range then the record should show in result.
Can you please help me? I'm confused after seeing all these configuration.