calculating with time
Ruslan Zasukhin
ruslan_zasukhin at valentina-db.com
Fri Dec 18 13:29:07 CST 2009
On 12/18/09 8:46 PM, "Gerri" <gerrri at gmx.de> wrote:
Hi Garry,
> I¹m using Valentina ADK for Director.
> One problem (I don¹t wanna speak about all my problems) is:
>
> I created a table with several fields of datatype varChar, which content
> actually time-values of the format
>
> 01:30:25
>
> The problem is: I can¹t calculate the difference of two of such time-values,
> because there is no lingo-function to convert that varChar or string to a
> time-value, even not to convert it to a number. Also I can¹t read the single
> values of that time¹-string.
> Is it somehow possible to manage this.
>
> I already tried the datatype TIME when creating the table. But when I want to
> get the difference I get the same wrong value (a negative integer) (also the
> TIME datatype returns a value with milliseconds, which I don¹t need)
>
> Maybe this is very easy to solve?
Okay, lets step by step.
1) I believe that you should use TIME field type.
Otherwise, why we did it? :)
2) Valentina have very very powerful Date Time SQL funcs.
You can read about them here:
http://valentina-db.com/dokuwiki/doku.php?id=valentina:vcomponents:vsql:refe
rence:expr:funcs_datetime
One of these funcs is DATEDIFF()
3) In fact these funcs can work even on your VarChar field,
IF format "01:30:25" is the same as specified to
db.DateTimeFormat
db.DateSep
db.TimeSep
Actually for time only TimeSep plays on parsing of string with time.
4) You say.
> TIME datatype returns a value with milliseconds, which I don¹t need)
To be continued ...
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the Valentina
mailing list