BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Timestamp and Filters

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
Lutz Kutscher
Guest





PostPosted: Wed Oct 15, 2003 10:12 am    Post subject: Timestamp and Filters Reply with 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
Yaron Nahum
Guest





PostPosted: Wed Oct 15, 2003 5:57 pm    Post subject: Re: Timestamp and Filters Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.