Subject | Re: [firebird-support] Re: Odd Behaviour!!!??? |
---|---|
Author | Pavel Menshchikov |
Post date | 2005-12-29T10:45:53Z |
Hello,
e> 1) Yes, you right. su.usage_date is a timestamp.
e> 2) Y should only records that occured exactly at midnight be included
e> and all others excluded? The comparision is supposed to include all
e> records for Nov 30.
e> 3) I have been able to fix it by cast the su.usage_date to DATE. But
e> am still confused on y it should fail without the cast.
In this case your date literals ('30-nov-2005' f.e.) were implicitely
converted to TIMESTAMP (as a "widest" type of the comparition) adding
00:00 as a time part. So, you get the beginning of the day (2005-11-30
00:00), not the end as you expect. Convert su.usage_date to DATE type
(in dialect 3), or cast the value to DATE as you do.
--
Best regards,
Pavel Menshchikov
http://www.ls-software.com
e> 1) Yes, you right. su.usage_date is a timestamp.
e> 2) Y should only records that occured exactly at midnight be included
e> and all others excluded? The comparision is supposed to include all
e> records for Nov 30.
e> 3) I have been able to fix it by cast the su.usage_date to DATE. But
e> am still confused on y it should fail without the cast.
In this case your date literals ('30-nov-2005' f.e.) were implicitely
converted to TIMESTAMP (as a "widest" type of the comparition) adding
00:00 as a time part. So, you get the beginning of the day (2005-11-30
00:00), not the end as you expect. Convert su.usage_date to DATE type
(in dialect 3), or cast the value to DATE as you do.
--
Best regards,
Pavel Menshchikov
http://www.ls-software.com