Home » SQL & PL/SQL » SQL & PL/SQL » need help
need help [message #213042] Tue, 09 January 2007 03:43 Go to next message
pham
Messages: 17
Registered: August 2006
Junior Member
i get this input text (the date changes each time: for example 01.01.1900 00:00:00):

a.the_date BETWEEN TO_DATE('01-Jan-1990 00:00:00','DD-MON-YYYY HH24:MI:SS')
AND TO_DATE('01-Jan-1990 23:59:59','DD-MON-YYYY HH24:MI:SS')
AND b.the_date BETWEEN TO_DATE('01-Jan-2008 00:00:00','DD-MON-YYYY HH24:MI:SS')
AND TO_DATE('01-Jan-2008 23:59:59','DD-MON-YYYY HH24:MI:SS')
AND c.the_date BETWEEN TO_DATE('01-Jan-2007 00:00:00','DD-MON-YYYY HH24:MI:SS')
AND TO_DATE('01-Jan-2007 23:59:59','DD-MON-YYYY HH24:MI:SS')

and have to take it in the WHERE-clausel

it look like that:

select a.the_date, b.the_date, c.the_date
from stat_calendar a,
stat_calendar b,
stat_calendar c
where
a.the_date BETWEEN TO_DATE('01-Jan-1990 00:00:00','DD-MON-YYYY HH24:MI:SS')
AND TO_DATE('01-Jan-1990 23:59:59','DD-MON-YYYY HH24:MI:SS')
AND b.the_date BETWEEN TO_DATE('01-Jan-2008 00:00:00','DD-MON-YYYY HH24:MI:SS')
AND TO_DATE('01-Jan-2008 23:59:59','DD-MON-YYYY HH24:MI:SS')
AND c.the_date BETWEEN TO_DATE('01-Jan-2007 00:00:00','DD-MON-YYYY HH24:MI:SS')
AND TO_DATE('01-Jan-2007 23:59:59','DD-MON-YYYY HH24:MI:SS');

the table stat_calendar has date from 1.1.1998 until 31.12.2050. So, if the the date not found in stat_calendar, i don't get a row back.

I can not expand the table stat_calendar. I can not change the input-text

I don't have some idea and need help.

Re: need help [message #213046 is a reply to message #213042] Tue, 09 January 2007 03:56 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
What exactly is the problem that you're encountering?
Re: need help [message #213047 is a reply to message #213046] Tue, 09 January 2007 04:01 Go to previous messageGo to next message
pham
Messages: 17
Registered: August 2006
Junior Member
i have to get a row which the input date even if the input date not to find in table stat_calendar.
Re: need help [message #213051 is a reply to message #213047] Tue, 09 January 2007 04:17 Go to previous message
pham
Messages: 17
Registered: August 2006
Junior Member
The tast is:

I have to build a SELECT statement to get out the three date:

TO_DATE('01-Jan-1990 00:00:00','DD-MON-YYYY HH24:MI:SS')
TO_DATE('01-Jan-2008 00:00:00','DD-MON-YYYY HH24:MI:SS') and
TO_DATE('01-Jan-2007 00:00:00','DD-MON-YYYY HH24:MI:SS')

with the input text for the WHERE clausel. I have no chance to change the input text.

Previous Topic: Connect by help
Next Topic: query
Goto Forum:
  


Current Time: Sat Dec 10 01:05:51 CST 2016

Total time taken to generate the page: 0.09448 seconds