Subject Re: [IBO] Date calculations
Author Helen Borrie
At 10:31 AM 22-06-01 +0200, you wrote:
>Hi!
>I have a problem that appears only in very rare cases, but it appears...
>
>'Docdate' is a Timestamp field. I default it to "now". The column properties
>are set to NO TIME.
>
>In other query I have:
>WHERE docdate<='today'
>
>In most cases this works, but 1...5 customers are having problems - i.e. the
>todays records are not selected.
>When I look my table with some Interbase tool, then I see field values only
>as 22.06.2001, without time part as it should be.
>
>
>I try to change the 'now' to 'today' and hope this helps, but the question
>remains - what's the reason?

'Today' looks for all dates <= 'dd.mm.yyyy 00:00:00' so any dates with that date and a time later than midnight will not meet your criterion. If you want all dates that have 'today's date' then your query must ask for

WHERE docdate > 'yesterday' and docdate < 'tomorrow'
or
WHERE docdate BETWEEN 'yesterday' AND 'tomorrow'.

Regards,
Helen



>Riho-Rene Ellermaa
>senior programmer
>Hansabank
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________