comparing to datetime columns in an Oraclew query matching just on Date

Experts,

I have two datetime fields in Oracle that I just want to compare the Date part  because the time part is different.  Does anyone know how to code this in Oracle?
moriniaAdvanced Analytics AnalystAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
A few ways but it depends on exactly what you are wanting.

If there is no index on the fields:
trunc(column_name) will zero out the time portion of dates.

It is normally better to use >= and < because there are typically indexes on date fields:
column_name >= some_date and column_name < some_other_date+1

If you can provide more information about what you mean by 'compare' we can adjust our suggestions.
0
moriniaAdvanced Analytics AnalystAuthor Commented:
This is my query,   I am not getting equal as is because Table 4 has a time and Table 5 time is zeroes

Case
when (SELECT t5.maintdate
          FROM Table5 T5
          WHERE T5.CLAIM = T1.CLAIM
          AND T5.OPID = 'AAAA')  =
       (SELECT T4.DATE_TIME
       FROM Table4 T4
        WHERE T4.CLAIM = T1.CLAIM
        AND T4.TERMID = 'AAAA')
                    then  'YES'  
        else '   '
end AUTO_ADJ
0
slightwv (䄆 Netminder) Commented:
Use trunc:
SELECT trunc(t5.maintdate) ...

SELECT trunc(T4.DATE_TIME)...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.