Board index » delphi » Time field param doesn't convert right

Time field param doesn't convert right


2003-07-04 04:25:34 AM
delphi64
I have a database with a Time field. I have to query this table using that
time field. I am using TIBDataset. In my app, when I have a time variable
and assign its value to the call_time parameter in the query but it doesn't
get into the parameter accurately. An example is:
Variable Time Query Param
Time
0.41463888889 9:57:04.8 AM 0.41462962963 9:57:04 AM
As you can see, the parameter doesn't pick up the 8/10ths of a second.
Therefore record is not found. How can this be fixed?
IBX 5.03, Delphi 5 Pro.
Thanks.
Don Gollahon
 
 

Re:Time field param doesn't convert right

QC Programmer writes:
Quote
We have an older version of this routine for IB 5 when the type was
timestamp and it worked then. We switched to separate date and time
fields because it was much easier to do certain summary reports (by
day for instance). I take it the fraction of seconds (milliseconds)
work as timestamp types. So, maybe if our time field was timestamp
then we could do the lookup.

What do you think?
You can try, but I doubt it will help. I also think that either:
o What you are describing doesn't work with IB 5, or
o It did work with IB 5, but is not as you are describing, and will
probably work with IB 7 as well.
InterBase has enough internal precision to store milliseconds, but it
isn't exposed in the date/time APIs. There are some tricks you can use
to get and set the millisecond data, but IMHO it is not worth doing as
it will not be convenient to use with third-party software such as
Crystal Reports and the like.
-Craig
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : delphi.weblogs.com
InterBase Performance Monitor -- Analyze and control your IB7
server: delphi.weblogs.com/IBPerformanceMonitor