Welcome Guest, Not a member yet? Register   Sign In
"Sophisticated" Between
#1

Hello.
In my company, there are lots of project that have their own start date and end date. I want to know what project are now between two dates. But the situation is not simple. I use mysql. For example, i want to know what projects are now between October 5 and October 30. It is easy to get it , just using query between , since one of the start date or end date is between Oct 5 and Oct 30.

But the problem is,if there are project start date Sept 1 and end date Dec 10...it will not get detected because the search form is between is Oct 5 and Oct 30.
Because in my company, if i search what projects are between Oct 5 and Oct 30, that project started 1 Sept and ends Dec 10 should be result too.


Is there any other command in mysql that between that allow us to search dates that are going through it?

I hope you undertand my languange. Thanks
Reply
#2

how about select * from where startdate<cast(30oct as date) and enddate>cast(05oct as date)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB