dbTalk Databases Forums  

Date Comparison Doesn't Work

comp.databases.rdb comp.databases.rdb


Discuss Date Comparison Doesn't Work in the comp.databases.rdb forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris Bullivant
 
Posts: n/a

Default Date Comparison Doesn't Work - 08-06-2003 , 12:09 AM






I've inherited Oracle RDB7 foe OpenVMS - not very knowledgeable on either.
I've been struggling with this for a week.

I'm running the following SQL script

set default date format 'SQL92';
select min(cast(t_most as date)), max(cast(t_most as date))
from idi_msg_rec
where t_moad_address = ''P1' or t_mrad_address = ''P1'
and (cast(current_date as date)) = (cast(t_most as date))
;

The output is
2003-07-30 2003-08-05

The t-most column is type TIMESTAMP.
Today is 2003-08-06 so why don't I get 0 rows?
If I leave out the finial condition I get exactly the same
result.
Why does this date comparison not work?

Thanks in advance for any help

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.