HOWTO: Use the SQL Server DATEPART Function to Get Milliseconds (186265)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- ActiveX Data Objects (ADO) 2.1 SP2
- ActiveX Data Objects (ADO) 2.5
- ActiveX Data Objects (ADO) 2.6
This article was previously published under Q186265 SUMMARY
You can use the SQL Server DATEPART() function to get the milliseconds of a
SQL Server datetime field returned to a Visual Basic application.
The advantage of using the SQL Server DATEPART() function is that it is
simple to use and works with all versions of ADO, DAO, and RDO. The
disadvantage of using the DATEPART() function is that it is specific to SQL
Server. However, other servers may have comparable functions.
Do not confuse the SQL Server DATEPART() function with the Visual Basic
DatePart() function, which is used with the Visual Basic Date datatype.
REFERENCES
For more information on the SQL Server DATEPART() function, look in the
SQL Server Books Online. Click Transact-SQL Reference, F, Functions,
Date Functions.
Modification Type: | Minor | Last Reviewed: | 3/14/2005 |
---|
Keywords: | kbDatabase kbhowto KB186265 |
---|
|