 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Lutz Kutscher Guest
|
Posted: Wed Oct 15, 2003 10:12 am Post subject: Timestamp and Filters |
|
|
Hi,
I'm trying to build some kind of bookmark functionality.
My dataset contains a time stamp field, whose value I store as the bookmark.
Unfortunately I can't find the record again.
I'm using the Filter and FindFirst property and method to go to the
bookmark, but setting the filter to
Filter := 'TimeStamp=' + QuotedStr(FormatDateTime('dd.mm.yyyy hh:nn:ss',
SearchValue));
doesn't locate the record since the resulting string doesn't contain the
milliseconds.
Is there a way to get the precise DateTime value into a string that can be
handled by the filtering methods?
--
_____________________________________
Lutz Kutscher
Pattburg Poetzsch GmbH & Co KG
Tel. +49 461 773 15 60
Fax +49 461 773 15 15
[email]LKutscher (AT) graensen (DOT) dk[/email]
|
|
| Back to top |
|
 |
Yaron Nahum Guest
|
Posted: Wed Oct 15, 2003 5:57 pm Post subject: Re: Timestamp and Filters |
|
|
Hello,
Timestamp field is represented by float where the integer part is
representing the date
(usually starting 1 = 1/1/1900)
and the decimal part is representing the time (from 12:00 am)
now as you may know there is the common problem with floating point
represtation.
you may save 13.5 and because of the way floating point is saved into the
database
when you recall it will be 13.4999999999
so generally it is not recommended to set index or find records by floating
point.
the best you can do is set a range using the filter and search thru the
records.
or put an integer as your bookmark
HTH
Yaron.
"Lutz Kutscher" <LKutscher (AT) Graensen (DOT) dk> wrote
| Quote: | Hi,
I'm trying to build some kind of bookmark functionality.
My dataset contains a time stamp field, whose value I store as the
bookmark.
Unfortunately I can't find the record again.
I'm using the Filter and FindFirst property and method to go to the
bookmark, but setting the filter to
Filter := 'TimeStamp=' + QuotedStr(FormatDateTime('dd.mm.yyyy
hh:nn:ss',
SearchValue));
doesn't locate the record since the resulting string doesn't contain the
milliseconds.
Is there a way to get the precise DateTime value into a string that can be
handled by the filtering methods?
--
_____________________________________
Lutz Kutscher
Pattburg Poetzsch GmbH & Co KG
Tel. +49 461 773 15 60
Fax +49 461 773 15 15
[email]LKutscher (AT) graensen (DOT) dk[/email]
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|