Determine all data between 2 dates [message #645317] |
Thu, 03 December 2015 02:35 |
|
parawos
Messages: 3 Registered: December 2015
|
Junior Member |
|
|
Hello,
i have folowing problem. In my database I have several intervalls:
1. Table
validfrom validto
01.01.15 - 02.02.15
02.02.15 - 15.03.15
15.03.15 - ....
I have to select for a given date intervall, for example from 03.02.15 until 16.03.15 all results from 1. Table. End result should be:
validfrom validto
03.02.15 - 15.03.15
15.03.15 - 16.03.15
I am not an expert in PL/SQL, that I tried to use between function...but I didn't achieve my result. Could you please help me?
|
|
|
Re: Determine all data between 2 dates [message #645319 is a reply to message #645317] |
Thu, 03 December 2015 02:51 |
|
Michel Cadot
Messages: 68645 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
You have to return all rows where validfrom is lower than your first date but with with validto greater then this one, and validto is greater than your second date but with validfrom lower than this one.
There is no need of function (but maybe TO_DATE is your inputs are strings) just OR and AND.
[Updated on: Thu, 03 December 2015 02:52] Report message to a moderator
|
|
|
|
|
|
|