Subject | Re: Including year in search of timestamp field |
---|---|
Author | bhatakeyama |
Post date | 2002-08-03T00:54:03Z |
--- In ib-support@y..., Helen Borrie <helebor@t...> wrote:
either convert the '2002-01-01' and '2002-08-03' to binary or
convert the data field to text, or maybe both to a 'tm' structure.
If I have an expression of:
... WHERE MyStoredTimestamp CONTAINING '08-03'
It retrieves all Auguest 3 records and excludes all others. To
me this implies that the engine is converting my text correctly
to match my Timestamp, or more likely the engine is converting
the timestamp to text.
Similarly if I have a 32-bit integer the following expression works:
... WHERE MyInt CONTAINING '1'
Will retrieve records, MyInt=
1, 10, 11, 12, ..., 21, 31, etc.
This also makes it appear that the integer is being converted to
a string and then a text comparison is being made.
Are you implying that both of these should be invalid?
Thanks.
______________________________________________________________________
>string,
> The TIMESTAMP type (along with the other date/time types) is not a
> it is a numerical value. Therefore, when searching on date/timetypes, the
> criteria must evaluate to numbers, not strings.search expressions
>
> Date literals (which look like strings) can be used in
> involving complete date or date/time types. In some situations, youneed
> to CAST date literals. However, because the engine does notinterpret date
> literals as strings, it is not valid to use CONTAINING, LIKE orSTARTING
> WITH in a date search.Since Timestamps are stored in 64-bit binary the engine has to
>
> An example of a timestamp search expression would be
> ...WHERE MyStoredTimestamp BETWEEN '2002-01-01' AND '2002-08-03'
either convert the '2002-01-01' and '2002-08-03' to binary or
convert the data field to text, or maybe both to a 'tm' structure.
If I have an expression of:
... WHERE MyStoredTimestamp CONTAINING '08-03'
It retrieves all Auguest 3 records and excludes all others. To
me this implies that the engine is converting my text correctly
to match my Timestamp, or more likely the engine is converting
the timestamp to text.
Similarly if I have a 32-bit integer the following expression works:
... WHERE MyInt CONTAINING '1'
Will retrieve records, MyInt=
1, 10, 11, 12, ..., 21, 31, etc.
This also makes it appear that the integer is being converted to
a string and then a text comparison is being made.
Are you implying that both of these should be invalid?
Thanks.
______________________________________________________________________