Save date with milliseconds using oleDB

General discussion forum about all databases other than SqlBase.
Marcio_cota

Save date with milliseconds using oleDB

Post by Marcio_cota » 08 Apr 2010, 13:45

I´m using SqlServer

With ODBC I save current datetime and milliseconds is save in database
With OleDB the milliseconds isn´t save into database

How can I save milliseconds into sqlserver datetime column with oledb??

EWetzel
Germany
Posts: 272
Joined: 07 Mar 2017, 12:08
Location: Germany

Re: Save date with milliseconds using oleDB

Post by EWetzel » 08 Apr 2010, 16:20

Hi,

I had the same problem.

I convert the datetime-var in a string-var for the sqlserver with the format "yyyy-mm-dd hh:mm:ss.nnnnnnn" and
save this string-var in a datetime2 column.
In my case this works.

best regards
Enrico

Jeff Luther

Re: Save date with milliseconds using oleDB

Post by Jeff Luther » 08 Apr 2010, 23:19

Thanks for the tip, Enrico!

Marcio_cota

Re: Save date with milliseconds using oleDB

Post by Marcio_cota » 09 Apr 2010, 13:11

is there no other way to do this?

Getdate() has 3 number into milleseconds but if I save this string date it just save 2 number

Ex:
Getdate() = 2010-04-09 09:01:39.376
Saved ==== 2010-04-09 09:01:39.38

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 1 guest