Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Outer join with date field?
Hi --
I'm using Workgroup Server 7.3
I'm fairly new at this, but I'm trying to join an outer join on date fields from two different tables. This works fine if I'm comparing the entire date, as in:
Select a.date, b.date from test1 a, test2 b where a.date = b.date (+);
However, this is not what I need. I need to be able to comparing only the date portion of the fields, not the time. I'd like to be able to do something like this:
Select a.date1, b.date2 from test1 a, test2 b where to_char(a.date,'YYDDD') = to_char(b.date,'YYDDD') (+);
This doesn't work, yielding an ORA-00933 error: SQL command not properly ended.
Is there any way to do this? It works great as an inner join, but being able to do outer joins in this manner would be very useful. I suppose I could split up the date and time data into 2 columns, but I'd really rather not.
Please reply via email, as well as to the group
Thanks in advance,
Mike
Received on Wed Feb 04 1998 - 00:00:00 CST