Article ID: 193869 - Last Review: March 14, 2005 - Revision: 2.3 How To Get Fractions of a Second from ADO adDBTimeStamp FieldThis article was previously published under Q193869 On This PageSUMMARY
The ActiveX Data Objects (ADO) field type 135, adDBTimeStamp, represents a
date-time stamp in the form of "yyyymmddhhmmss" plus a fraction in
billionths. Therefore, an ADO adDBTimeStamp field can contain the fraction
returned from a server Date/Time field. For example, an ADO adDBTimeStamp
field can contain the fractional portion of a SQL Server 6.5 DATETIME
field.
If you try to assign the ADO adDBTimeStamp field to a Visual Basic DATE datatype variable or to output the field value, Visual Basic drops the fractional portion of seconds for the adDBTimeStamp field. This article demonstrates how to retrieve the fractional portion of seconds from an adDBTimeStamp field. MORE INFORMATION
You may use a function, such as GetMilliseconds, to retrieve the fractional
portion of an adDBTimeStamp field and convert the billionths to fractions
of a second. The following code uses the Visual Basic decimal datatype to
help perform the conversion, but you could create a string function to
parse the fractional value.
Step-by-Step Example
REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
186265
(http://support.microsoft.com/kb/186265/EN-US/
)
How To Use the SQL Server DATEPART Function to Get Milliseconds
For information on the ADO adDBTimeStamp datatype, please see the ADO Online Documentation for the Type property.
Visual Basic Help; search on: "Date Data Type" SQL Server Books Online; search on: "datetime", topic: "Date and Time data" APPLIES TO
| Article Translations
|
Back to the top
