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

compare the time out of date-variables with pl/sql 1

Status
Not open for further replies.

mokesql

Programmer
Sep 6, 2001
30
AT
hi!
i want to compare the time of a date-variable and the sysdate but dont want to have the date involved ind the competition. so to understand the problem better i`ll try to explain fruther: if the date-variable as example has the value=04.09.2001 14:34 and the sysdate is 07.09.2001 14:34 i want that the competition returns true so the competition just depends on the time. is there a funktion for this or do i need to solve it whit substr? please, please help

moke
 
You may compare dates as well as numbers, the result is in days. In your example you may use
sign(example_date-sysdate).
 
There may be other options, but I would do this using the "to_char" function to get only the time portion of the date:

if to_char(date_variable,'hh24:mi:ss') = to_char(sysdate,'hh24:mi:ss') ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top