Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Linking two tables with Dates

Re: Linking two tables with Dates

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 21 Feb 2001 23:49:48 -0800
Message-ID: <3A94C49C.C8AE9A5B@exesolutions.com>

I would suggest that the two answers you have previously received may be missing an important piece of the puzzle.

You can almost never write a WHERE clause like:

    WHERE date_field = date_value

The reason is that date field in Oracle do not just contain the date. They also contain the time. Try this instead:

    WHERE TRUNC(date_field) = TRUNC(date_value)

Daniel A. Morgan

Zanfar Ali wrote:

> I have two tables called work and payrate:
>
> in work there is two fields a date and a description.
>
> WORK
> DATE DESCRIPTION
> 20-Feb-2001 worked on sometething
> 15-Feb-2001 worked on sometething
> 14-Feb-2001 worked on sometething
> 12-Feb-2001 worked on sometething
>
> in payrate i have a history of a persons payrates and the date it was set
>
> PAYRATE
> DATSET RATE/Hour
> 16-Feb-2001 23.45
> 12-Feb-2001 21.45
>
> the dateset means that from 12-Feb-2001 to 15-Feb-2001 the payrate was 21.45
> and then from 16-Feb-2001 to today the payrate was 23.45.This table can have
> more entries.
>
> What i need to do is to link the work table entries with the corresponding
> payrate...?
>
> Any help will be highly appreciated!
Received on Thu Feb 22 2001 - 01:49:48 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US