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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

join tables on Date part of a field

Status
Not open for further replies.

Glowworm27

Programmer
May 30, 2003
587
US
I have two relational tables, and in the tables the have a date/time field called clock_hours.

I want to join the two tables on this field but only on the DATE part, and not the TIME part of the field.

For instance TableA.Clock_Hours = 01/01/2007 11:55:00 PM and TableB.Clock_Hours = 01/01/2007 9:55:10 AM

I want the Join to be just on the date 01/01/2007

Can you tell me how I would do this?
thanks

George Oakes
Check out this awsome .Net Resource!
 
I suppose your date/time field has datatype date ?
Then have a look at functions to_char or trunc, e.g.
... where trunc(TableA.Clock_Hours) = trunc(TableB.Clock_Hours)

hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top