Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to select date range from two tables

Status
Not open for further replies.

tyb

Technical User
Feb 10, 2004
137
IR
Dear frends
plz help
i'v two tables each having the date field, now i want to select the mximum and min date from both tables to show in the parameter form.

also plz advise me on how to use the date between function such that if the Ist & 2nd date are the same. it would select for the same date.

i.e. where date between date1 & date2 --if date1 & date2 are same -- then it would select for the same date.
 
Tyb,

How you are receiving 993 rows from the above query just baffles me. Perhaps we need some fresh eyes looking at the problem.

Sem, Carp, Dagon, alexhu, lewisp, khobar, karluk, jimbopalmer, hoinz: can any of you suggest reasons why/how Tyb sees more than 67 rows of output on the query, above?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 15:51 (02Nov04) UTC (aka "GMT" and "Zulu"),
@ 08:51 (02Nov04) Mountain Time
 
THANKS SANTA FOR UR PATIENCE

U'V CONSUMED MUCH TIME FOR ME AND I REALLY APPRECIATE IT.


MANY CARDIAL THANKS.
 
Tyb,

Did you finally resolve the problem. I'd really like to stick with it until the correct answer appears.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 06:13 (08Nov04) UTC (aka "GMT" and "Zulu"),
@ 23:13 (07Nov04) Mountain Time
 
Not yet.

but i just wanted not to waste ur further time on this problem.

Best Regards
 
Tyb,

If we don't stick with the problem until you are satisfied with a working solution, then that is when it becomes a waste of time.

How does my working scenario (with real data that should match your data) differ from your test situation? The code and data, above, do exactly what you wanted. If we can identify how your situation differs, we should be able to resolve your need.

Please advise.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 06:44 (10Nov04) UTC (aka "GMT" and "Zulu"),
@ 23:44 (09Nov04) Mountain Time
 
Thanks Santa.

Best Regards.
 
Hi ,

I think it's about the number of objects
in 'all_objects'. allthough it dosen't make any sense because of the stmt. 'where min_date+(rownum-1) <= max_date'


I tried the same query with the same data , it retreived 6238 records, from 18-jun-03 until 15-jul-20

SQL> select count(*) from all_objects;

COUNT(*)
---------
6238

??
 
Both Tyb and Nadeu,

It would help in troubleshooting our differences is you both ran, and posted the results from, this query:
Code:
SELECT max(desp_date) - min(desp_date)
FROM despatch;

I look forward to seeing your postings.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 15:51 (10Nov04) UTC (aka "GMT" and "Zulu"),
@ 08:51 (10Nov04) Mountain Time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top