here the string '14/07/03 23:57:37.506'
i'd like to insert into a datetime field in sql server with milliseconds,
how to do this
i've to use like this
Table1.Insert
Table1.FieldByName('logdate').AsString := datestring;
Table1.Post;
it works but not inserting millseconds how to do this
thanks
Table1.FieldByName('logdate').AsString := FormateDateTime('dd/mm/yyyy
hh:nn:zzz', dtDateValue);
where dtDateValue is a TDateTime.This will give date values with the format:
01/04/2003 22:25:1043 (for example)
Hope this helps
Gord
"Ganesh" <gsga...@yahoo.com> wrote in message
news:3f1699bf$1...@newsgroups.borland.com...
No still having problem
even i tried
Table1.Insert
Table1.FieldByName('logdate').AsString := '14/07/03 23:57:37.506';
Table1.Post;
but not inserting milli seconds
"Henrik Bruhn" <H.B...@WIDEX.DK> wrote in message
news:3f169db1$1...@newsgroups.borland.com...
> > i'd like to insert into a datetime field in sql server with
milliseconds,
> > here the string '14/07/03 23:57:37.506'
>
> Delphi and Windows apparently do not support milliseconds in the DateTime
> formats.
> But you can use: DateTimetoStr(T) + '.' + IntToStr(MilliSecondOf(T))
>
> Henrik
>
>
Delphi and Windows apparently do not support milliseconds in the DateTime
Henrik, The Delphi TDateTime variable type *does*
support a resolution of milliseconds. What other
aspect of Delphi and Windows might you be referring
to. Rgds, JohnH
>Hi there,
>
>here the string '14/07/03 23:57:37.506'
>
>i'd like to insert into a datetime field in sql server with milliseconds,
>how to do this
>
>i've to use like this
>
>Table1.Insert
>Table1.FieldByName('logdate').AsString := datestring;
>Table1.Post;
If you have the various elements of the date and time as numeric values, you can use
Table1.FieldByName('logdate').Value := EncodeDate( ... ) + EncodeTime( ... );
John Leavey
John
I was referring to the conversion of TDateTime to string and was not aware
of the 'z' specifier.
PS: Thanks to Gord (GC) for the information
Henrik
"Henrik Bruhn" <H.B...@WIDEX.DK> wrote in message
news:3f16...@newsgroups.borland.com...
I have read somewhere that BDE does not supports milliseconds in DateTime
fields.
It is better to post your question in b.p.bde where you can expect a
reasonable answer.
Sujit
"Ganesh" <gsga...@yahoo.com> wrote in message
news:3f1699bf$1...@newsgroups.borland.com...
a) convert the datetime to a decimal with 10 decimal places
b) use a update or insert script - eg 'Update table1 set logdate =
37816.9983507639 where ...(identify row etc)'
Mike
"Ganesh" <gsga...@yahoo.com> wrote in message
news:3f1699bf$1...@newsgroups.borland.com...